
Recherche avancée
Autres articles (112)
-
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...) -
Modifier la date de publication
21 juin 2013, parComment changer la date de publication d’un média ?
Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
Dans la rubrique "Champs à ajouter, cocher "Date de publication "
Cliquer en bas de la page sur Enregistrer -
Prérequis à l’installation
31 janvier 2010, parPréambule
Cet article n’a pas pour but de détailler les installations de ces logiciels mais plutôt de donner des informations sur leur configuration spécifique.
Avant toute chose SPIPMotion tout comme MediaSPIP est fait pour tourner sur des distributions Linux de type Debian ou dérivées (Ubuntu...). Les documentations de ce site se réfèrent donc à ces distributions. Il est également possible de l’utiliser sur d’autres distributions Linux mais aucune garantie de bon fonctionnement n’est possible.
Il (...)
Sur d’autres sites (4210)
-
Compiling FFmpeg staticly using NDK with openssl
27 février 2017, par David BarishevI have been trying to compile ffmpeg into a static library in order to use it in my android application, but i couldn’t get it to work.
Im working with FFmpeg 3.2.4, and ndk r13b, using bash on windows 10(Ubuntu 14.04).
Here is what i did :
-
I made a stand alone toolchain for x86_64 and api 21 using :
python make_standalone_toolchain.py --api 21 --arch x86_64 --install-dir {}
-
Made a configuration script :
./configure \
--target-os=android \
--arch=x86_64 \
--prefix=/home/david/ffmpeg_x86_64_build \
--cross-prefix=/home/david/x86_64_toolchain/bin/x86_64-linux-android-\
--sysroot=/home/david/x86_64_toolchain/sysroot \
--enable-cross-compile \
--pkg-config-flags="--static" \
--enable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
--extra-cflags="-fPIC" \
--extra-cxxflags="-fPIC"
--disable-shared --enable-static \
--enable-yasm
make
make install
It produced an FFmpeg executable, however when i ran it on my API 23 emulator, i got an error message :
error: only position independent executables (PIE) are supported.
Even that i used -fPicHow can i fix it ? Also i’m not sure about my configuration, there wasn’t up to date sources on how to compile it correctly for every ABI (arm,arm64,x86,x86_64,mips,mips64) that i need for my application.
I have seen many script, and im not too familiar with compiling native code, so i wasn’t sure what settings i need, for example like C flags and etc.To be precise on how i tried to configure FFmpeg :
- I need a static library
- I Only need the ffmpeg command line utility
- I want to compile the library for every ABI i listed above.This configuration tried to compile for x86_64.
- Running on android of course
I would greatly appreciate some help on how to configure and compile this correctly.
EDIT
Thanks to @Alex Cohn i have been able to compile ffmpeg, however i couldn’t get it to compile using —enable-ssl however i have been faced with a problem.
Since we are providing a system root, the compiler won’t look for files on my host machine, so we will need need to compile ssl for android from source.
I have used this library OpenSSL-For-Android, and used the precompiled library.I added to the configure file these lines :
--extra-cflags='-m32 -fPIE -I./OpenSSL-For-Android/openssl-1.0.2j/include' \
--extra-ldflags='-m32 -Wl,-eh-frame-hdr -Wl,-m,elf_i386 -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -fPIE -pie -L./OpenSSL-For-Android/openssl-1.0.2j/lib/x86'I tried telling the config, that it should search for the headers of openssl here, and that it should link against this library here.
But it fails on this test as stated on config.log :
BEGIN /tmp/ffconf.JVeoLDmr.c
1 extern int SSL_library_init();
2 int main(void){ SSL_library_init(); }
END /tmp/ffconf.JVeoLDmr.c
/home/david/ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc --sysroot=/home/david/ndk/platforms/android-9/arch-x86/ -isysroot /home/david/ndk/platforms/android-9/arch-x86/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -m32 -fPIE -I./OpenSSL-For-Android/openssl-1.0.2j/include -std=c99 -fomit-frame-pointer -fPIC -pthread -c -o /tmp/ffconf.x5yr8e11.o /tmp/ffconf.JVeoLDmr.c
/home/david/ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc -m32 -Wl,-eh-frame-hdr -Wl,-m,elf_i386 -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -fPIE -pie -L./OpenSSL-For-Android/openssl-1.0.2j/lib/x86 --sysroot=/home/david/ndk/platforms/android-9/arch-x86/ -isysroot /home/david/ndk/platforms/android-9/arch-x86/ -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.mxzx6kFL /tmp/ffconf.x5yr8e11.o -lssl -lcrypto -lws2_32 -lgdi32 -lm -pthread
/home/david/ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lssl
/home/david/ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lws2_32
/home/david/ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: cannot find -lgdi32
/tmp/ffconf.x5yr8e11.o:ffconf.JVeoLDmr.c:function main: error: undefined reference to 'SSL_library_init'And it seems like it doesn’t use the precompiled shared library i passed it(since it’s compiled for Android) and doesn’t find another instance of openssl, since the sysroot is the Android AOSP one (this is what I am thinking, please correct me if I’m wrong - I’m not experienced enough in this field ) .
How can this be fixed ? I have seen some setups with PKG-Config, but i have no clue as how to configure it correctly. -
-
Evolution #3426 : enrichir la détection des robots
1er novembre 2015, par Ben .if (!defined(’_IS_BOT’)) define(’_IS_BOT’, isset($_SERVER[’HTTP_USER_AGENT’]) AND preg_match( // mots generiques ’,bot|slurp|crawler|spider|webvac|yandex|’ // MSIE 6.0 est un botnet 99,9% du temps, on traite donc ce USER_AGENT comme un bot . ’MSIE 6\.0|’ // UA plus cibles . ’200please|360spider|80legs|a6-indexer|abachobot|aboundex|aboutusbot|accoona|aciorobot|addsearchbot|addthis|adressendeutschland|adsbot-google|ahrefsbot|aihitbot|alexa|altavista|amznkassocbot|analyticsseo|antbot|arabot|archive|askpeterbot|aspseek|backlinkcrawler|baidu|baiduspider|begunadvertising|bingbot|bingpreview|bitlybot|bixocrawler|blekkobot|blexbot|bloglines|brainbrubot|browsershots|bubing|bufferbot|butterfly|careerbot|catchbot|ccbot|changedetection|charlotte|chilkat|china|claritybot|classbot|cliqzbot|coccoc|cococrawler|compspybot|crawler|crawler4j|crowsnest|crystalsemanticsbot|dataminr|daumoa|dlweb|dotbot|dumbot|easouspider|ec2linkfinder|estyle|exabot|ezooms|facebookexternalhit|facebookplatform|fairshare|fast-webcrawler|feedfetcher|feedfetcher-google|feedly|feedlybot|fetch|figleafbot|flipboardproxy|fyberspider|genieo|geonabot|gigabot|google|googlebot|grapeshot|hatena-useragent|head|hosttracker|hubspot|ia_archiver|icc-crawler|ichiro|idbot|iltrovatore-setaccio|immediatenet|ina|infegyatlas|infohelfer|instapaper|ixebot|jabse|james|java|jikespider|jyxobot|kumkie|linkdex|linkfluence|linkwalker|litefinder|loadimpactpageanalyzer|luminate|lycos|lycosa|magpie-crawler|meanpathbot|mediapartners-google|metageneratorcrawler|metajobbot|mj12bot|mojeekbot|msai|msnbot|msnbot-media|msrbot|musobot|najdi|nalezenczbot|nekstbot|netcraftsurveyagent|netestate|netseer|nuhk|obot|omgilibot|openwebspider|panscient|parsijoo|plukkie|proximic|psbot|qihoobot|qirina|qualidator|queryseekerspider|rambler|readability|rogerbot|ru_bot|sbsearch|scooter|scrapy|scrubby|scrubbybloglines|searchbot|searchmetricsbot|semrushbot|seocheckbot|seoengworldbot|seokicks-robot|seznambot|shareaholic|shopwiki|showyoubot|sistrix|sitechecker|siteexplorer|slurp|socialbm_bot|sogou|sosoimagespider|sosospider|spbot|special_archiver|speedy|spider|spiderling|spiderman|spinn3r|spreadtrum|steeler|subscriber|suggybot|suma|superdownloads|surveybot|svenska-webbsido|teoma|thumbshots|tineye|trendiction|turnitinbot|tweetedtimes|tweetmeme|twitterbot|uaslinkchecker|umbot|undrip|unisterbot|unwindfetchor|urlappendbot|vedma|vkshare|vm|voilabot|wbsearchbot|wch|web|webalta|webcookies|webthumbnail|wesee|wise-guys|woko|woobot|woriobot|wotbox|y !j-bri|y !j-bro|y !j-brw|y !j-bsc|yacybot|yahoo|yahoo !|yahooysmcm|yandexbot|yats|yeti|yioopbot|yodaobot|youdaobot|zb-1|zeerch|zing-bottabot|zumbot’ . ’,i’,(string) $_SERVER[’HTTP_USER_AGENT’]) ) ;
si le pastebin meurt :)
-
Evolution #4427 (En cours) : Permettre (via une constante) de passer de 65 536 à 4096 le nombre ma...
24 janvier 2020, par - EquipementBonjour,
Concernant le cache de second niveau de SPIP, c’est-à-dire celui qui contient le résultat du calcul des squelettes :Jusqu’à la branche 3.0 de SPIP la taille maximum du cache était par défaut de 10 Mo.
A partir de la branche 3.1 de SPIP, le nombre maximal de fichier dans le cache est de 65 536 (et il n’y a plus de limite sur la taille du cache).
Sur un cas réel, le cache a atteint 2 Go (soit une moyenne de 31 Ko par fichier).
Certains hébergeurs ont un quota sur la taille, mais également sur le nombre d’inodes.
Dans un cas réel, des sites ont ainsi atteint le quota d’inodes, ce qui empêchait l’accès à l’espace privé des sites (cf. contrib.spip.net/Plugins-Giseh#comment502510).Remarque : L’expérience montre que le passage d’un robot, qui n’est pas identifié par SPIP, peut suffit à garnir le cache. Or la liste des robots détectés par SPIP ne sera jamais exhaustive. Par ailleurs, pour certains robots (aspirateurs de sites ou autre) il est possible de modifier leur user-agent.
Aussi, je propose que, via l’ajout d’une constante dans le fichier mes_options, il soit possible de fixer le nombre maximal de fichier dans le cache à 4096 (au lieu de 65 536). Cette approche, par constante optionnelle, évite d’impacter les sites qui veulent conserver la limite de 65 536 fichiers.
En pratique, il s’agit d’offrir la possibilité de mettre dans le fichier mes_options la constante suivante :
- <span class="CodeRay"><span class="predefined">define</span>(<span class="string"><span class="delimiter">'</span><span class="content">_CACHE_MAX_4096_FILES</span><span class="delimiter">'</span></span>,<span class="predefined-constant">true</span>) ;
- </span>
et de prendre en compte cette constante dans le fichier ecrire/public/cacher.php de la manière suivante :
- <span class="CodeRay"><span class="keyword">function</span> <span class="function">ecrire_cache</span>(<span class="local-variable">$nom_cache</span>, <span class="local-variable">$valeur</span>) {
- <span class="comment">// $d = substr($nom_cache, 0, 2);</span>
- <span class="comment">// $u = substr($nom_cache, 2, 2);</span>
- <span class="local-variable">$longueur_d</span> = <span class="integer">2</span>;
- <span class="keyword">if</span> (<span class="predefined">defined</span>(<span class="string"><span class="delimiter">'</span><span class="content">_CACHE_MAX_4096_FILES</span><span class="delimiter">'</span></span>) <span class="keyword">AND</span> _CACHE_MAX_4096_FILES){
- <span class="local-variable">$longueur_d</span> = <span class="integer">1</span>;
- }
- <span class="local-variable">$d</span> = <span class="predefined">substr</span>(<span class="local-variable">$nom_cache</span>, <span class="integer">0</span>, <span class="local-variable">$longueur_d</span>);
- <span class="local-variable">$u</span> = <span class="predefined">substr</span>(<span class="local-variable">$nom_cache</span>, <span class="local-variable">$longueur_d</span>, <span class="integer">2</span>);
- <span class="local-variable">$rep</span> = _DIR_CACHE;
- <span class="local-variable">$rep</span> = sous_repertoire(<span class="local-variable">$rep</span>, <span class="string"><span class="delimiter">'</span><span class="delimiter">'</span></span>, <span class="predefined-constant">false</span>, <span class="predefined-constant">true</span>);
- <span class="local-variable">$rep</span> = sous_repertoire(<span class="local-variable">$rep</span>, <span class="local-variable">$d</span>, <span class="predefined-constant">false</span>, <span class="predefined-constant">true</span>);
- <span class="keyword">return</span> ecrire_fichier(<span class="local-variable">$rep</span> . <span class="local-variable">$u</span> . <span class="string"><span class="delimiter">"</span><span class="content">.cache</span><span class="delimiter">"</span></span>, <span class="predefined">serialize</span>(<span class="predefined">array</span>(<span class="string"><span class="delimiter">"</span><span class="content">nom_cache</span><span class="delimiter">"</span></span> => <span class="local-variable">$nom_cache</span>, <span class="string"><span class="delimiter">"</span><span class="content">valeur</span><span class="delimiter">"</span></span> => <span class="local-variable">$valeur</span>)));
- }
- <span class="keyword">function</span> <span class="function">lire_cache</span>(<span class="local-variable">$nom_cache</span>) {
- <span class="comment">// $d = substr($nom_cache, 0, 2);</span>
- <span class="comment">// $u = substr($nom_cache, 2, 2);</span>
- <span class="local-variable">$longueur_d</span> = <span class="integer">2</span>;
- <span class="keyword">if</span> (<span class="predefined">defined</span>(<span class="string"><span class="delimiter">'</span><span class="content">_CACHE_MAX_4096_FILES</span><span class="delimiter">'</span></span>) <span class="keyword">AND</span> _CACHE_MAX_4096_FILES){
- <span class="local-variable">$longueur_d</span> = <span class="integer">1</span>;
- }
- <span class="local-variable">$d</span> = <span class="predefined">substr</span>(<span class="local-variable">$nom_cache</span>, <span class="integer">0</span>, <span class="local-variable">$longueur_d</span>);
- <span class="local-variable">$u</span> = <span class="predefined">substr</span>(<span class="local-variable">$nom_cache</span>, <span class="local-variable">$longueur_d</span>, <span class="integer">2</span>);
- <span class="keyword">if</span> (<span class="predefined">file_exists</span>(<span class="local-variable">$f</span> = _DIR_CACHE . <span class="string"><span class="delimiter">"</span><span class="local-variable">$d</span><span class="content">/</span><span class="local-variable">$u</span><span class="content">.cache</span><span class="delimiter">"</span></span>)
- <span class="keyword">and</span> lire_fichier(<span class="local-variable">$f</span>, <span class="local-variable">$tmp</span>)
- <span class="keyword">and</span> <span class="local-variable">$tmp</span> = <span class="predefined">unserialize</span>(<span class="local-variable">$tmp</span>)
- <span class="keyword">and</span> <span class="local-variable">$tmp</span>[<span class="string"><span class="delimiter">'</span><span class="content">nom_cache</span><span class="delimiter">'</span></span>] == <span class="local-variable">$nom_cache</span>
- <span class="keyword">and</span> <span class="predefined">isset</span>(<span class="local-variable">$tmp</span>[<span class="string"><span class="delimiter">'</span><span class="content">valeur</span><span class="delimiter">'</span></span>])
- ) {
- <span class="keyword">return</span> <span class="local-variable">$tmp</span>[<span class="string"><span class="delimiter">'</span><span class="content">valeur</span><span class="delimiter">'</span></span>];
- }
- <span class="keyword">return</span> <span class="predefined-constant">false</span>;
- }
- </span>
Cordialement
Equipement