Bianca fylder da 10 år

Hej Bianca og tillykke med din 10 års fødselsdag. Så må vi håbe dine forældre har købt dig nogle gaver du ønsker dig.


Hilsen Joakim

Posted on

Force deleting a obsolete printer in windows

Take a look at this tutorial which explains how to use the Microsoft Management Console (MMC), to remove unwanted printer driver packages.

If that does not work for you, try using the printui.exe tool.

In an admin elevated command prompt type printui /s /t2, be sure to remove the driver AND the package.

Here’s how to do it, step-by-step:

  1. Open a command line with administrative rights: Start->All Programs->Accessories->Command prompt; Right click -> Run As Administrator
  2. Run the printui tool: printui /s /t2
  3. Try deleting the printers. If that doesn’t work… (i.e., if removing the printers listed in the printui is not successful.)
  4. Click Start > Run > Services.msc
  5. Locate the Print Spooler service, and right-click > Properties > stop service.
  6. Open My Computer and browse to C:\Windows\System32\spool\Printers (you will need to click “OK” to get access to the folder).
  7. DELETE the contents of the folder you opened in step 7.
  8. Go back to services.msc and Restart the Print Spooler service.
  9. Go back into the printui utility (you might need to restart it using same method as above) and try removing printers again. This time it should work. If necessary, check the “Ports” tab and remove any TCP/IP ports that are associated with the old printer.
  10. Last but not least, check other computers on your home network to see if any of those map to the old printer, and remove these mappings

Posted on

Nu kan du søge os med !reck på :)

You can now search directly using !reck — one of the many #DuckDuckGo !bang shortcuts:

– Bill Connor

Posted on

Bikini Model Academy

When T. J. and Benji, two California twenty-something best buddies, lose their girlfriends, they start a home grown bikini modeling academy to make money and meet new girls. With a little help from T.J.’s Uncle Seymour (Gary Busey), the guys begin recruiting pretty girls, until a rival modeling school owned by their old grade school enemy tries to shut them down.

Cast: Gary Busey, Morgan Fairchild, Benjamin Stone, Phillip Andre Botello, Michelle May, Olivia Alexander, Andriana Manfredi, Meg Braden, Tara Rice Clark Gilmer, Adam Weisman, Edward Coupland, Emily Bedford, Sina J. Henrie, Jayda Berkmen

Posted on

Maleficent – The Movie

A beautiful, pure-hearted young woman, Maleficent has an idyllic life growing up in a peaceable forest kingdom, until one day when an invading army threatens the harmony of the land. Maleficent rises to be the land’s fiercest protector, but she ultimately suffers a ruthless betrayal – an act that begins to turn her pure heart to stone. Bent on revenge, Maleficent faces a battle with the invading king’s successor and, as a result, places a curse upon his newborn infant Aurora. As the child grows, Maleficent realizes that Aurora holds the key to peace in the kingdom – and perhaps to Maleficent’s true happiness as well.

Cast: Angelina Jolie, Elle Fanning, Sharlto Copley, Lesley Manville, Imelda Staunton, Juno Temple, Sam Riley, Brenton Thwaites, Kenneth Cranham, Sarah Flind, Isobelle Molloy, Michael Higgins, Ella Purnell, Jackson Bews

Posted on

mysql comand to import straight from csv file

This is tested on Mariadb 10.x on CentOS 7 and working splendid by using mysqlimport.

In this example where are using a db name CSV_Import
A csv file named db.csv

mysqlimport --local --fields-terminated-by='|' --columns='Url,Title,Duration,Thumbnail,Embed,Keywords,Category' -u root -p CSV_Import /root/db.csv

--local = import from a local stored files
--fields-terminated-by='|' = which character is used to divide the different import fields in the csv file, typical dividers is ; , |
--columns='' = used to tell which fields and order data is stored in the csv file. IMPORTANT use comma as divider

Posted on

Compilation Guide for FFmpeg on CentOS 7

This guide is based on a minimal installation of the latest CentOS release, and will provide a local, non-system installation of FFmpeg with support for several external encoding libraries. These instructions should also work for recent Red Hat Enterprise Linux (RHEL) and Fedora. This is a non-invasive guide and undoing all steps is simple and is shown at the end of this page.

Get the Dependencies

Note: The # indicates that the command should be executed as superuser or root.

Get the dependencies. These are required compiling, but you can remove them when you are done if you prefer (except make; it should be installed by default and many things depend on it).

# yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel

In your home directory make a new directory to put all of the source code into:

mkdir ~/ffmpeg_sources; cd ~/ffmpeg_sources

Compilation & Installation

Note: If you do not require certain encoders you may skip the relevant section and then remove the appropriate ./configure option in FFmpeg. For example, if libvorbis is not needed, then skip that section and then remove --enable-libvorbis from the Install FFmpeg section.


Yasm is an assembler used by x264 and FFmpeg.

cd ~/ffmpeg_sources
git clone --depth 1 git://
cd yasm
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make install
make distclean


H.264 video encoder. See the H.264 Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with --enable-gpl --enable-libx264.

cd ~/ffmpeg_sources
git clone --depth 1 git://
cd x264
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
make install
make distclean


H.265/HEVC video encoder. See the H.265 Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with --enable-gpl --enable-libx265.

cd ~/ffmpeg_sources
hg clone
cd ~/ffmpeg_sources/x265/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make install


AAC audio encoder.

Requires ffmpeg to be configured with --enable-libfdk-aac (and --enable-nonfree if you also included --enable-gpl).

cd ~/ffmpeg_sources
git clone --depth 1 git://
cd fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make install
make distclean


MP3 audio encoder.

Requires ffmpeg to be configured with --enable-libmp3lame.

cd ~/ffmpeg_sources
curl -L -O
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
make install
make distclean


Opus audio decoder and encoder.

Requires ffmpeg to be configured with --enable-libopus.

cd ~/ffmpeg_sources
git clone git://
cd opus
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make install
make distclean


Ogg bitstream library. Required by libtheora and libvorbis.

cd ~/ffmpeg_sources
curl -O
tar xzvf libogg-1.3.2.tar.gz
cd libogg-1.3.2
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make install
make distclean


Vorbis audio encoder. Requires libogg.

Requires ffmpeg to be configured with --enable-libvorbis.

cd ~/ffmpeg_sources
curl -O
tar xzvf libvorbis-1.3.5.tar.gz
cd libvorbis-1.3.5
LDFLAGS="-L$HOME/ffmeg_build/lib" CPPFLAGS="-I$HOME/ffmpeg_build/include" ./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
make install
make distclean


VP8/VP9 video encoder.

Requires ffmpeg to be configured with --enable-libvpx.

cd ~/ffmpeg_sources
git clone --depth 1
cd libvpx
./configure --prefix="$HOME/ffmpeg_build" --disable-examples
make install
make clean


cd ~/ffmpeg_sources
git clone
cd ffmpeg
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
make install
make distclean
hash -r

Compilation is now complete and ffmpeg (also ffprobe, ffserver, lame, and x264) should now be ready to use. The rest of this guide shows how to update or remove FFmpeg.
You should also read the Performance Tips before compiling FFmpeg

Tip: Keep the ffmpeg_sources directory and all contents if you intend to update as shown below. Otherwise you can delete this directory.


Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First, remove the old files and then update the dependencies:

rm -rf ~/ffmpeg_build ~/bin/{ffmpeg,ffprobe,ffserver,lame,vsyasm,x264,x265,yasm,ytasm}
# yum install autoconf automake cmake gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel

Update Yasm

cd ~/ffmpeg_sources/yasm
make distclean
git pull

Then run ./configure, make, and make install as shown in the Install yasm section.

Update x264

cd ~/ffmpeg_sources/x264
make distclean
git pull

Then run ./configure, make, and make install as shown in the Install x264 section.

Update x265

cd ~/ffmpeg_sources/x265
rm -rf ~/ffmpeg_sources/x265/build/linux/*
hg update
cd ~/ffmpeg_sources/x265/build/linux

Then run cmake, make, and make install as shown in the Install x265 section.

Update libfdk_aac

cd ~/ffmpeg_sources/fdk_aac
make distclean
git pull

Then run ./configure, make, and make install as shown in the Install libfdk_aac section.

Update libvpx

cd ~/ffmpeg_sources/libvpx
make clean
git pull

Then run ./configure, make, and make install as shown in the Install libvpx section.

Update FFmpeg

cd ~/ffmpeg_sources/ffmpeg
make distclean
git pull

Then run ./configure, make, and make install as shown in the Install FFmpeg section.

Reverting changes made by this guide

rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffserver,lame,vsyasm,x264,yasm,ytasm}
# yum erase autoconf automake cmake gcc gcc-c++ git libtool mercurial nasm pkgconfig zlib-devel
hash -r

Performance Tips

There are numerous avenues to extract maximum performance out of FFmpeg when it is built from source. The following list describes some of them:

  • If using GCC, consider adding -ftree-vectorize to --extra-cflags. Most recent versions of GCC do not miscompile FFmpeg with the auto-vectorizer enabled, and can easily reap a general 1-2% increase in performance from a FATE run (make fate-rsync; make fate), with gains varying across the codebase and compiler version. However, the project does not currently maintain a list of compiler versions under which the vectorizer works correctly, since even recent releases like 4.8.0 had problems. Therefore, configure by default disables the auto-vectorizer on GCC, and it must be enabled by the user explicitly if desired, such as via the method outlined above. It is highly advised to test at least a FATE run to ensure that things work correctly when the auto-vectorizer is turned on.
  • If using GCC/Clang, consider adding -march=native to --extra-cflags to make slightly better use of your hardware. Alternatively, for a more general solution, examine the --arch and --cpu options. Gains are variable, and usually quite small. However, this is usually even more safe than the above, and is thus listed here.
  • Depending on your use case, --enable-hardcoded-tables may be a useful option. It results in an increase of approximately 15% in the size of libavcodec, the main library impacted by this change. It enables savings in table generation time, done once at codec initialization, since by hardcoding the tables, they do not need to be computed at runtime. However, the savings are often negligible (~100k cycles is a typical number) especially when amortized over the entire encoding/decoding operation. By default, this is not enabled. Improvements are being made to the runtime initialization, and so over time, this option will have an impact on fewer and fewer codecs.
  • Other options may be found by examining ./configure --help.

Also See


Posted on

HOWTO Install ffmpeg and php-ffmpeg on CentOS 7.1


  • CentOS 7, with full root access.

Note: This method for ffmpeg install also works for centos 6.x, cpanel, directadmin.

Import the GPG key from the repo:

rpm --import 

Install the ATRPMS Repo:

rpm -ivh 

Ffmpeg requires libdc1394-devel and it is available in epel repository. Execute the following command to install epel repository:
       rpm -Uvh 

Install FFMpeg from ATRPMS Repository:

yum -y --enablerepo=atrpms install ffmpeg ffmpeg-devel 

Verify the ffmpeg version:

ffmpeg -version 
[email protected] [~]# ffmpeg -version
ffmpeg version 2.2.1
built on Jun 17 2014 01:25:46 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --disable-stripping
libavutil      52. 66.100 / 52. 66.100
libavcodec     55. 52.102 / 55. 52.102
libavformat    55. 33.100 / 55. 33.100
libavdevice    55. 10.100 / 55. 10.100
libavfilter     4.  2.100 /  4.  2.100
libswscale      2.  5.102 /  2.  5.102
libswresample   0. 18.100 /  0. 18.100
libpostproc    52.  3.100 / 52.  3.100
[email protected] [~]# 

Install php-ffmpeg extension:

yum -y install git
git clone 
cd ffmpeg-php 
make install

Take a backup of php.ini

cp /usr/local/lib/php.ini /usr/local/lib/php.ini.backup

Add the ffmpeg extension to php.ini

echo "" >> /usr/local/lib/php.ini

Restart http server

service httpd restart

Verify ffmpeg is loading from PHP:

php -i | grep ffmpeg -i 
[email protected] [~]# php -i | grep ffmpeg -i
ffmpeg-php version => 0.7.0
ffmpeg-php built on => Jul 28 2015 15:27:12
ffmpeg-php gd support  => enabled
ffmpeg libavcodec version => Lavc55.52.102
ffmpeg libavcodec license => GPL version 3 or later
ffmpeg libavformat version => Lavf55.33.100
ffmpeg libavformat license => GPL version 3 or later
ffmpeg swscaler version => SwS2.5.102
ffmpeg swscaler license => GPL version 3 or later
ffmpeg codec_list => a64multi(v), a64multi5(v), aasc(v), aic(v), amv(v), amv(v), anm(v), ansi(v), asv1(v), asv1(v), asv2(v), asv2(v), aura(v), aura2(v), avrp(v), avrp(v), avrn(v), avs(v), avui(v), avui(v), ayuv(v), ayuv(v), bethsoftvid(v), bfi(v), binkvideo(v), bmp(v), bmp(v), bmv_video(v), brender_pix(v), c93(v), cavs(v), cdgraphics(v), cdxl(v), cinepak(v), cinepak(v), cljr(v), cljr(v), cllc(v), comfortnoise(a), comfortnoise(a), cpia(v), camstudio(v), cyuv(v), dfa(v), dirac(v), dnxhd(v), dnxhd(v), dpx(v), dpx(v), dsicinvideo(v), dvvideo(v), dvvideo(v), dxa(v), dxtory(v), eacmv(v), eamad(v), eatgq(v), eatgv(v), eatqi(v), 8bps(v), 8svx_exp(a), 8svx_fib(a), escape124(v), escape130(v), exr(v), ffv1(v), ffv1(v), ffvhuff(v), ffvhuff(v), fic(v), flashsv(v), flashsv(v), flashsv2(v), flashsv2(v), flic(v), flv(v), flv(v), 4xm(v), fraps(v), frwu(v), g2m(v), gif(v), gif(v), h261(v), h261(v), h263(v), h263(v), h263i(v), h263p(v), h263p(v), h264(v), h264_vdpau(v), hevc(v), hnm4video(v), huffyuv(v), huffyuv(v), idcinvideo(v), iff(v), iff(v), indeo2(v), indeo3(v), indeo4(v), indeo5(v), interplayvideo(v), jpeg2000(v), jpeg2000(v), jpegls(v), jpegls(v), jv(v), kgv1(v), kmvc(v), lagarith(v), ljpeg(v), loco(v), mdec(v), mimic(v), mjpeg(v), mjpeg(v), mjpegb(v), mmvideo(v), motionpixels(v), mpeg1video(v), mpeg1video(v), mpeg2video(v), mpeg2video(v), mpeg4(v), mpeg4(v), mpeg4_vdpau(v), mpegvideo(v), mpegvideo_vdpau(v), mpeg1video_vdpau(v), msa1(v), msmpeg4v1(v), msmpeg4v2(v), msmpeg4v2(v), msmpeg4(v), msmpeg4(v), msrle(v), mss1(v), mss2(v), msvideo1(v), msvideo1(v), mszh(v), mts2(v), mvc1(v), mvc2(v), mxpeg(v), nuv(v), paf_video(v), pam(v), pam(v), pbm(v), pbm(v), pcx(v), pcx(v), pgm(v), pgm(v), pgmyuv(v), pgmyuv(v), pictor(v), png(v), png(v), ppm(v), ppm(v), prores(v), prores(v), prores_aw(v), prores_ks(v), prores_lgpl(v), ptx(v), qdraw(v), qpeg(v), qtrle(v), qtrle(v), r10k(v), r10k(v), r210(v), r210(v), rawvideo(v), rawvideo(v), rl2(v), roqvideo(v), roqvideo(v), rpza(v), rv10(v), rv10(v), rv20(v), rv20(v), rv30(v), rv40(v), s302m(a), s302m(a), sanm(v), sgi(v), sgi(v), sgirle(v), smackvid(v), smc(v), smvjpeg(v), snow(v), snow(v), sp5x(v), sunrast(v), sunrast(v), svq1(v), svq1(v), svq3(v), targa(v), targa(v), targa_y216(v), theora(v), thp(v), tiertexseqvideo(v), tiff(v), tiff(v), tmv(v), truemotion1(v), truemotion2(v), camtasia(v), tscc2(v), txd(v), ultimotion(v), utvideo(v), utvideo(v), v210(v), v210(v), v210x(v), v308(v), v308(v), v408(v), v408(v), v410(v), v410(v), vb(v), vble(v), vc1(v), vc1_vdpau(v), vc1image(v), vcr1(v), vmdvideo(v), vmnc(v), vp3(v), vp5(v), vp6(v), vp6a(v), vp6f(v), vp8(v), vp9(v), vqavideo(v), webp(v), wmv1(v), wmv1(v), wmv2(v), wmv2(v), wmv3(v), wmv3_vdpau(v), wmv3image(v), wnv1(v), xan_wc3(v), xan_wc4(v), xbm(v), xbm(v), xface(v), xface(v), xl(v), xwd(v), xwd(v), y41p(v), y41p(v), yop(v), yuv4(v), yuv4(v), 012v(v), zerocodec(v), zlib(v), zlib(v), zmbv(v), zmbv(v), aac(a), aac(a), aac_latm(a), ac3(a), ac3(a), ac3_fixed(a), alac(a), alac(a), als(a), amrnb(a), amrwb(a), ape(a), atrac1(a), atrac3(a), atrac3plus(a), binkaudio_dct(a), binkaudio_rdft(a), bmv_audio(a), cook(a), dca(a), dca(a), dsicinaudio(a), eac3(a), eac3(a), evrc(a), wavesynth(a), flac(a), flac(a), g723_1(a), g723_1(a), g729(a), gsm(a), gsm_ms(a), iac(a), imc(a), mace3(a), mace6(a), metasound(a), mlp(a), mp1(a), mp1float(a), mp2(a), mp2(a), mp2float(a), mp2fixed(a), mp3(a), mp3float(a), mp3adu(a), mp3adufloat(a), mp3on4(a), mp3on4float(a), mpc7(a), mpc8(a), nellymoser(a), nellymoser(a), paf_audio(a), qcelp(a), qdm2(a), real_144(a), real_144(a), real_288(a), ralf(a), shorten(a), sipr(a), smackaud(a), sonic(a), sonic(a), sonicls(a), tak(a), truehd(a), truespeech(a), tta(a), tta(a), twinvq(a), vmdaudio(a), vorbis(a), vorbis(a), wavpack(a), wavpack(a), wmalossless(a), wmapro(a), wmav1(a), wmav1(a), wmav2(a), wmav2(a), wmavoice(a), ws_snd1(a), pcm_alaw(a), pcm_alaw(a), pcm_bluray(a), pcm_dvd(a), pcm_f32be(a), pcm_f32be(a), pcm_f32le(a), pcm_f32le(a), pcm_f64be(a), pcm_f64be(a), pcm_f64le(a), pcm_f64le(a), pcm_lxf(a), pcm_mulaw(a), pcm_mulaw(a), pcm_s8(a), pcm_s8(a), pcm_s8_planar(a), pcm_s8_planar(a), pcm_s16be(a), pcm_s16be(a), pcm_s16be_planar(a), pcm_s16be_planar(a), pcm_s16le(a), pcm_s16le(a), pcm_s16le_planar(a), pcm_s16le_planar(a), pcm_s24be(a), pcm_s24be(a), pcm_s24daud(a), pcm_s24daud(a), pcm_s24le(a), pcm_s24le(a), pcm_s24le_planar(a), pcm_s24le_planar(a), pcm_s32be(a), pcm_s32be(a), pcm_s32le(a), pcm_s32le(a), pcm_s32le_planar(a), pcm_s32le_planar(a), pcm_u8(a), pcm_u8(a), pcm_u16be(a), pcm_u16be(a), pcm_u16le(a), pcm_u16le(a), pcm_u24be(a), pcm_u24be(a), pcm_u24le(a), pcm_u24le(a), pcm_u32be(a), pcm_u32be(a), pcm_u32le(a), pcm_u32le(a), pcm_zork(a), interplay_dpcm(a), roq_dpcm(a), roq_dpcm(a), sol_dpcm(a), xan_dpcm(a), adpcm_4xm(a), adpcm_adx(a), adpcm_adx(a), adpcm_afc(a), adpcm_ct(a), adpcm_dtk(a), adpcm_ea(a), adpcm_ea_maxis_xa(a), adpcm_ea_r1(a), adpcm_ea_r2(a), adpcm_ea_r3(a), adpcm_ea_xas(a), g722(a), g722(a), g726(a), g726(a), g726le(a), adpcm_ima_amv(a), adpcm_ima_apc(a), adpcm_ima_dk3(a), adpcm_ima_dk4(a), adpcm_ima_ea_eacs(a), adpcm_ima_ea_sead(a), adpcm_ima_iss(a), adpcm_ima_oki(a), adpcm_ima_qt(a), adpcm_ima_qt(a), adpcm_ima_rad(a), adpcm_ima_smjpeg(a), adpcm_ima_wav(a), adpcm_ima_wav(a), adpcm_ima_ws(a), adpcm_ms(a), adpcm_ms(a), adpcm_sbpro_2(a), adpcm_sbpro_3(a), adpcm_sbpro_4(a), adpcm_swf(a), adpcm_swf(a), adpcm_thp(a), adpcm_xa(a), adpcm_yamaha(a), adpcm_yamaha(a), vima(a), ssa(s), ssa(s), ass(s), ass(s), dvbsub(s), dvbsub(s), dvdsub(s), dvdsub(s), jacosub(s), microdvd(s), mov_text(s), mov_text(s), mpl2(s), pgssub(s), pjs(s), realtext(s), sami(s), srt(s), srt(s), subrip(s), subrip(s), subviewer(s), subviewer1(s), text(s), vplayer(s), webvtt(s), xsub(s), xsub(s), libgsm(a), libgsm(a), libgsm_ms(a), libgsm_ms(a), libmp3lame(a), libopencore_amrnb(a), libopencore_amrnb(a), libopencore_amrwb(a), libopenjpeg(v), libopenjpeg(v), libspeex(a), libspeex(a), libtheora(v), libvorbis(a), libvorbis(a), libvpx(v), libvpx(v), libx264(v), libx264rgb(v), libxavs(v), libxvid(v), bintext(v), xbin(v), idf(v), 
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
OLDPWD => /root/ffmpeg-php
_SERVER["OLDPWD"] => /root/ffmpeg-php
_ENV["OLDPWD"] => /root/ffmpeg-php
[email protected] [~]#


Posted on

Varnis-Cache v 4.x config file for wordpress

Tested and working Varnis-Cache v 4.x config file for wordpress

# Update of varnish 4 to work with wordpress
# Marker to tell the VCL compiler that this VCL has been adapted to the
# new 4.0 format.
vcl 4.0;

# Default backend definition. Set this to point to your content server.
backend default {
.host = "";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
.max_connections = 800;

# Only allow purging from specific IPs
acl purge {

# This function is used when a request is send by a HTTP client (Browser)
sub vcl_recv {
# Normalize the header, remove the port (in case you're testing this on various TCP ports)
set req.http.Host = regsub(req.http.Host, ":[0-9]+", "");

# Remove has_js and CloudFlare/Google Analytics __* cookies.
set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(_[_a-z]+|has_js)=[^;]*", "");
# Remove a ";" prefix, if present.
set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");

# Allow purging from ACL
if (req.method == "PURGE") {
# If not allowed then a error 405 is returned
if (!client.ip ~ purge) {
return(synth(405, "This IP is not allowed to send PURGE requests."));
# If allowed, do a cache_lookup -> vlc_hit() or vlc_miss()
return (purge);

# Post requests will not be cached
if (req.http.Authorization || req.method == "POST") {
return (pass);

# --- WordPress specific configuration

# Did not cache the admin and login pages
if (req.url ~ "wp-(login|admin)" || req.url ~ "preview=true") {
return (pass);

# Remove the "has_js" cookie
set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", "");

# Remove any Google Analytics based cookies
set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", "");

# Remove the Quant Capital cookies (added by some plugin, all __qca)
set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", "");

# Remove the wp-settings-1 cookie
set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-1=[^;]+(; )?", "");

# Remove the wp-settings-time-1 cookie
set req.http.Cookie = regsuball(req.http.Cookie, "wp-settings-time-1=[^;]+(; )?", "");

# Remove the wp test cookie
set req.http.Cookie = regsuball(req.http.Cookie, "wordpress_test_cookie=[^;]+(; )?", "");

# Are there cookies left with only spaces or that are empty?
if (req.http.cookie ~ "^ *$") {
unset req.http.cookie;

# Cache the following files extensions
if (req.url ~ "\.(css|js|png|gif|jp(e)?g|swf|ico)") {
unset req.http.cookie;

# Normalize Accept-Encoding header and compression
if (req.http.Accept-Encoding) {
# Do no compress compressed files...
if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
unset req.http.Accept-Encoding;
} elsif (req.http.Accept-Encoding ~ "gzip") {
set req.http.Accept-Encoding = "gzip";
} elsif (req.http.Accept-Encoding ~ "deflate") {
set req.http.Accept-Encoding = "deflate";
} else {
unset req.http.Accept-Encoding;

# Check the cookies for wordpress-specific items
if (req.http.Cookie ~ "wordpress_" || req.http.Cookie ~ "comment_") {
return (pass);
if (!req.http.cookie) {
unset req.http.cookie;

# --- End of WordPress specific configuration

# Did not cache HTTP authentication and HTTP Cookie
if (req.http.Authorization || req.http.Cookie) {
# Not cacheable by default
return (pass);

# Cache all others requests
return (hash);

sub vcl_pipe {
return (pipe);

sub vcl_pass {
return (fetch);

# The data on which the hashing will take place
sub vcl_hash {
if ( {
} else {

# If the client supports compression, keep that in a different cache
if (req.http.Accept-Encoding) {

return (lookup);

# This function is used when a request is sent by our backend (Nginx server)
sub vcl_backend_response {
# Remove some headers we never want to see
unset beresp.http.Server;
unset beresp.http.X-Powered-By;

# For static content strip all backend cookies
if (bereq.url ~ "\.(css|js|png|gif|jp(e?)g)|swf|ico") {
unset beresp.http.cookie;
# Don't store backend
if (bereq.url ~ "wp-(login|admin)" || bereq.url ~ "preview=true") {
set beresp.uncacheable = true;
set beresp.ttl = 30s;
return (deliver);

# Only allow cookies to be set if we're in admin area
if (!(bereq.url ~ "(wp-login|wp-admin|preview=true)")) {
unset beresp.http.set-cookie;

# don't cache response to posted requests or those with basic auth
if ( bereq.method == "POST" || bereq.http.Authorization ) {
set beresp.uncacheable = true;
set beresp.ttl = 120s;
return (deliver);

# don't cache search results
if ( bereq.url ~ "\?s=" ){
set beresp.uncacheable = true;
set beresp.ttl = 120s;
return (deliver);

# only cache status ok
if ( beresp.status != 200 ) {
set beresp.uncacheable = true;
set beresp.ttl = 120s;
return (deliver);

# A TTL of 2h
set beresp.ttl = 2h;
# Define the default grace period to serve cached content
set beresp.grace = 30s;

return (deliver);

# The routine when we deliver the HTTP request to the user
# Last chance to modify headers that are sent to the client
sub vcl_deliver {
if (obj.hits > 0) {
set resp.http.X-Cache = "cached";
} else {
set resp.http.x-Cache = "uncached";

# Remove some headers: PHP version
unset resp.http.X-Powered-By;

# Remove some headers: Apache version & OS
unset resp.http.Server;

# Remove some heanders: Varnish
unset resp.http.Via;
unset resp.http.X-Varnish;

return (deliver);

sub vcl_init {
return (ok);

sub vcl_fini {
return (ok);

If you use Cloudflare though… Make sure you set a varnish IP! in wp-config.php


Posted on

FFMPEG Autoscale on height or width

If you would like to scale your video using FFMPEG you can do this by Just using -2

From the FFMPEG scale filter documentation:

If one of the values is -n with n > 1, the scale filter will also use a value that maintains the aspect ratio of the input image, calculated from the other specified dimension. After that it will, however, make sure that the calculated dimension is divisible by n and adjust the value if necessary.


Set width to 1280, and height will automatically be calculated to preserve the aspect ratio, and the height will be divisible by 2:
-vf scale=1280:-2
Same as above, but with a declared height instead; leaving width to be dealt with by the filter:
-vf scale=-2:720

“divisible by 2”

As required by x264, the “divisible by 2 for width and height” is needed for YUV 4:2:0 chroma subsampled outputs. 4:2:2 would need “divisible by 2 for width”, and 4:4:4 does not have these restrictions. However, most non-FFmpeg based players can only properly decode 4:2:0, so that is why you often see ffmpeg commands with the -pix_fmt yuv420p option when outputting H.264 video.


Unfortunately you can’t use -2 for both width and height, but if you already specified one dimension then using -2 is a simple solution.

Posted on