
Recherche avancée
Autres articles (112)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.
Sur d’autres sites (10067)
-
AWS Lambda Docker image with librosa and ffmpeg
4 août 2022, par loretoparisiI'm using this
Dockerfile
to build an image for AWS Lambda havinglibrosa
andffmpeg
withpython3.7
:

ARG FUNCTION_DIR="/function"
FROM python:3.7.4-slim-buster as build-image

# librosa and ffmpeg dependencies
RUN apt-get update && apt-get install -y \
 software-properties-common \
 libsndfile1-dev \
 ffmpeg

# Install aws-lambda-cpp build dependencies
RUN apt-get update && \
 apt-get install -y \
 g++ \
 make \
 cmake \
 unzip \
 libcurl4-openssl-dev

# Include global arg in this stage of the build
ARG FUNCTION_DIR
# Create function directory
RUN mkdir -p ${FUNCTION_DIR}

# Copy function code
COPY app.py ${FUNCTION_DIR}

# Install the runtime interface client
RUN pip install \
 --target ${FUNCTION_DIR} \
 awslambdaric

# Multi-stage build: grab a fresh copy of the base image
FROM python:3.7.4-slim-buster

# Include global arg in this stage of the build
ARG FUNCTION_DIR
# Set working directory to function root directory
WORKDIR ${FUNCTION_DIR}

# Copy in the build image dependencies
COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR}

EXPOSE 8080
ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ]
CMD [ "app.handler" ]



The build works ok, but I cannot run the image :


docker run -e AWS_LAMBDA_RUNTIME_API=localhost:9000 --rm -it -p 9000:8080 lambda:latest
Executing 'app.handler' in function directory '/function'
[ERROR] [1628271126733] LAMBDA_RUNTIME Failed to get next invocation. No Response from endpoint
Traceback (most recent call last):
 File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
 "__main__", mod_spec)
 File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
 exec(code, run_globals)
 File "/function/awslambdaric/__main__.py", line 21, in <module>
 main(sys.argv)
 File "/function/awslambdaric/__main__.py", line 17, in main
 bootstrap.run(app_root, handler, lambda_runtime_api_addr)
 File "/function/awslambdaric/bootstrap.py", line 399, in run
 event_request = lambda_runtime_client.wait_next_invocation()
 File "/function/awslambdaric/lambda_runtime_client.py", line 76, in wait_next_invocation
 response_body, headers = runtime_client.next()
RuntimeError: Failed to get next
</module>


I therefore tried this simplified
Dockerfile
that is based on the AWS EC2 CentOS with package manageryum
:

FROM public.ecr.aws/lambda/python:3.8

# libsndfile
RUN curl -o libsndfile-1.0.28-alt1.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libsndfile-1.0.28-alt1.x86_64.rpm 
RUN curl -o libsndfile-devel-1.0.28-alt1.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libsndfile-devel-1.0.28-alt1.x86_64.rpm
#ffmpeg
RUN curl -o ffmpeg-4.4-alt5.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//ffmpeg-4.4-alt5.x86_64.rpm 

RUN yum localinstall \
 libsndfile-devel-1.0.28-alt1.x86_64.rpm \
 fmpeg-4.4-alt5.x86_64.rpm

# Create function directory
WORKDIR /app

# Copy function code
COPY app.py .

COPY requirements.txt .
RUN pip install -r requirements.txt

EXPOSE 8080
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
CMD ["/app/app.handler"]



In this case, the image builds and run and I can invoke the handler :


docker run --rm -it -p 9000:8080 lambda:latest
INFO[0000] exec '/var/runtime/bootstrap' (cwd=/app, handler=) 
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'



but I
librosa
complains about thelibsndfile1
installation :

Traceback (most recent call last):
 File "/var/runtime/bootstrap.py", line 452, in main
 request_handler = _get_handler(handler)
 File "/var/runtime/bootstrap.py", line 46, in _get_handler
 m = imp.load_module(modname, file_handle, pathname, desc)
 File "/var/lang/lib/python3.8/imp.py", line 234, in load_module
 return load_source(name, filename, file)
 File "/var/lang/lib/python3.8/imp.py", line 171, in load_source
 module = _load(spec)
 File "<frozen>", line 702, in _load
 File "<frozen>", line 671, in _load_unlocked
 File "<frozen>", line 848, in exec_module
 File "<frozen>", line 219, in _call_with_frames_removed
 File "/app/app.py", line 7, in <module>
 import librosa
 File "/var/lang/lib/python3.8/site-packages/librosa/__init__.py", line 211, in <module>
 from . import core
 File "/var/lang/lib/python3.8/site-packages/librosa/core/__init__.py", line 6, in <module>
 from .audio import * # pylint: disable=wildcard-import
 File "/var/lang/lib/python3.8/site-packages/librosa/core/audio.py", line 8, in <module>
 import soundfile as sf
 File "/var/lang/lib/python3.8/site-packages/soundfile.py", line 142, in <module>
 raise OSError('sndfile library not found')
OSError: sndfile library not found

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
 File "/var/runtime/bootstrap.py", line 480, in <module>
 main()
 File "/var/runtime/bootstrap.py", line 457, in main
 lambda_runtime_client.post_init_error(to_json(error_result))
 File "/var/runtime/lambda_runtime_client.py", line 42, in post_init_error
 response = runtime_connection.getresponse()
 File "/var/lang/lib/python3.8/http/client.py", line 1344, in getresponse
 response.begin()
 File "/var/lang/lib/python3.8/http/client.py", line 307, in begin
 version, status, reason = self._read_status()
 File "/var/lang/lib/python3.8/http/client.py", line 276, in _read_status
 raise RemoteDisconnected("Remote end closed connection without"
 http.client.RemoteDisconnected: Remote end closed connection without response
 WARN[0023] First fatal error stored in appctx: Runtime.ExitError 
 WARN[0023] Process 16(bootstrap) exited: Runtime exited with error: exit status 1 
 ERRO[0023] Init failed InvokeID= error="Runtime exited with error: exit status 1"
 WARN[0023] Failed to send default error response: ErrInvalidInvokeID 
 ERRO[0023] INIT DONE failed: Runtime.ExitError 
 WARN[0023] Reset initiated: ReserveFail 
</module></module></module></module></module></module></frozen></frozen></frozen></frozen>


The strange thing in this case (
yum
andrmp
) is that the installation seems to work fine :

=> CACHED [2/9] RUN curl -o libsndfile-1.0.28-alt1.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libsndfile-1.0.2 0.0s
 => CACHED [3/9] RUN curl -o libsndfile-devel-1.0.28-alt1.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//libsndfile 0.0s
 => CACHED [4/9] RUN curl -o ffmpeg-4.4-alt5.x86_64.rpm http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/RPMS.classic//ffmpeg-4.4-alt5.x86_64 0.0s
 => CACHED [5/9] RUN yum localinstall libsndfile-devel-1.0.28-alt1.x86_64.rpm fmpeg-4.4-alt5.x86_64.rpm 



-
Anomalie #3205 (Nouveau) : [Plugin-dist Mots] Incompatibilité avec l’API d’édition d’objet ?
13 avril 2014, par charles razackIl semblerait que la création d’un groupe de mots par le biais l’API d’édition d’objet ne fonctionne pas.
A première vue, on dirait que c’est dû à un souci de nommage de fonctions au niveau du plugin.Pour reproduire, dans le traitement d’un formulaire par ex. :
include_spip('action/editer_objet');<br />$set = array('titre'=>'Mon super titre',, 'tables_liees'=>'articles');<br />$id_groupe = objet_inserer('groupe_mots', '', $set);
var_dump($id_groupe);
renvoieNULL
et pour cause : le groupe de mots n’a pas été créé.Cause probable :
Dans le fichier
action/editer_groupe_mots.php
du plugin, les fonctions sont nomméesgroupemots_xxx()
au lieu degroupe_mots_xxx()
,
ce qui fait que la fonctionobjet_inserer()
de l’API ne les trouve pas.
Du coup elle tente une insertion "générique" qui pour une raison ou une autre ne fonctionne pas (pb avec sql_insertq ligne 209, je n’ai pas regardé ce qui cloche exactement). -
Use ffmpeg with paths in flutter
19 septembre 2023, par ivan reyesI have no idea how to use ffmpeg from paths. In all the examples I have seen use files from assets, and this solution does not apply to my problem.


This is an example that is in another question here : How to extract audio from video using ffmpeg-kit with flutter


@override
 void initState() {
 // TODO: implement initState
 super.initState();
 getAudio();
 }

 getAudio() async {
 await FFmpegKit.execute(
 "ffmpeg -i D:/Dart and Flutter/Projects/Jmm/firebase_task/assets/videos/flutter.mp4 -q:a 0 -map a D:/Dart and Flutter/Projects/Jmm/firebase_task/assets/videos/flutter_audio.mp3")
 .then((value) async {
 var returnCode = await value.getReturnCode();
 if (ReturnCode.isSuccess(returnCode)) {
 print('succsses');
 } else {
 print('fail');
 }
 });
 }



but, again, they convert the files from assets.


I hope you can help, thank you very much


I tried to adapt the solution that they apply in the link provided, and I expected to have an audio file, but, this did not happen