Building Awesome 3.5 from Source in Debian Sid
// debian, awesome, stupid wiki

Edited on

So here's a small how to based on previous rage post with Awesome 3.5

First, install dependencies: (stupid debian wiki not listing every one of them)

sudo apt-get install cmake liblua5.1-dev imagemagick libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-keysyms1-dev libxcb-icccm4-dev libx11-xcb-dev lua-lgi-dev libstartup-notification0-dev libxdg-basedir-dev libxcb-image0-dev libxcb-util0-dev libgdk-pixbuf2.0-dev lua5.1 libxcb-cursor-dev libcairo2-dev

Fetch the source from git with:

git clone git://git.naquadah.org/awesome.git

cd awesome

git remote add origin-debian git://git.debian.org/git/users/acid/awesome.git

git fetch origin-debian

Let's build it!

cmake -DCMAKE_PREFIX_PATH=/usr -DSYSCONFDIR=/etc && make

Then install it with:

sudo make install

sudo ldconfig -v

Ta-da! You are done.


Building Awesome from source is bullshit
// source, tiling, thoughts

So I wanted AwesomeWM 3.5 on my Debian Sid box. Guess what, 3.5 is only in experimental? Nope.gif. I could have installed it with dpkg though as I now realize, but I went ahead and built it from source.

...oh dear what a mess.

The wiki is great. Especially these two things:

  • Incomplete dependencies listed
  • Different build methods

Yeah, maybe somebody should update it.. Anyway, after deciphering what deps it really wants, I finally got it installed! Yay me. Now I get to enjoy All these 3.5 goodies that are... err... well..... Ok atleast I got to install these goodlooking rc.lua's.

All's good in the kings lair once again. Long live tiling window managers!


Why is Python syntax so good?
// python, syntax, php

I mean come on! I used to be a PHP-only developer. Thought nothing of the syntax, sometimes just wondering why there has to be semicolon at the end of every line. Oh well, keep coding anyway.

But then - something happend - I tried Python. Lol forced indentation? Come on! No curly braces around loops/if-statements/etc? Lol how dumb.

I went forward though. Soon I realized how wonderful it was, everything was so simple. No more syntax error because forgot curly brace or semicolon. Indentation made everything clear enough. Python does not feel like a programming language, (inb4 someone says that PHP isn't proper one anyway) because it is so easy to work with. The flow is amazing, everything feels so logical and natural, it almost feels unreal. Every time I have to do PHP nowadays, my syntax is f'd up at the beginning because I am thinking in Python. The curly braces, semicolons and everything don't feel logical anymore. Fuck that, I wanna do Python instead!


Open Source the site
// open source, github

I decided to open the source of this small blog.

There's not much code, since it's a pretty basic Flask-FlatPages with Frozen-Flask combination.

In addition there's a small post publishing script, deploy.sh.

Anyway, you can find it on GitHub. Go check it out!


New layout
// css, simple

Good news everyone!

I redid the site a bit!

Featuring:

  • New, narrower layout
  • About Me page! (yay)
  • Simplified code
  • Err.. that's all I guess.. :(

Made using Flask-FlatPages and Flask-Frozen. Good stuff :)


Private Netflix clone in Flask
// python, flask, video

I have been working on a project that creates a private video gallery!

It's perfect for your own use.

Here's some features:

  • Authentication
  • Automated adding of new videos
  • Subtitle support (via mediaelement player)
  • Automatic movie info retrieval (Need RottenTomatoes free API key for this)
  • Secure file serving using X-Accel-Redirect header

You can find the project on GitHub.


Installing FFmpeg from source on Debian Wheezy
// ffmpeg, debian, wheezy

I needed to encode videos with FFmpeg for my project recently, but found it is not compiled with codecs I needed by default. Here's a guide how to do that by hand.

Step 1 - Install dependecies

Install debian-multimedia repo by opening /etc/apt/sources.list:

deb http://deb-multimedia.org wheezy main non-free
deb-src http://deb-multimedia.org wheezy non-free

Next run the following to install the repository:

apt-get -y --force-yes install deb-multimedia-keyring; apt-get update

Then install required packages:

apt-get install subversion unzip frei0r-plugins-dev libdc1394-22-dev libfaac-dev \
libmp3lame-dev libx264-dev libdirac-dev libxvidcore-dev libfreetype6-dev \
libvorbis-dev libgsm1-dev libopencore-amrnb-dev libopencore-amrwb-dev \
libopenjpeg-dev librtmp-dev libschroedinger-dev libspeex-dev libtheora-dev \
libva-dev libvpx-dev libvo-amrwbenc-dev libvo-aacenc-dev libaacplus-dev libbz2-dev \
libgnutls-dev libssl-dev libopenal-dev libv4l-dev libpulse-dev libmodplug-dev \
libass-dev libcdio-dev libcdio-cdda-dev libcdio-paranoia-dev libvdpau-dev \
libxfixes-dev libxext-dev libbluray-dev

Next download and compile libxavs with the following:

svn co https://svn.code.sf.net/p/xavs/code/trunk xavs

cd xavs

./configure --enable-shared --disable-asm

make && make install

Step 2 - Install FFmpeg

Download source by issuing:

wget http://www.ffmpeg.org/releases/ffmpeg-2.1.1.tar.gz

Unzip it: tar zxf ffmpeg-2.1.1.tar.gz && cd ffmpeg-2.1.1

Next we configure it:

./configure --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads \
--enable-x11grab --enable-swscale --enable-version3 --enable-shared --disable-yasm \
--enable-filter=movie --enable-frei0r --enable-libdc1394 --enable-libfaac \
--enable-libmp3lame --enable-libx264 --enable-libxvid \
--enable-libfreetype --enable-libvorbis --enable-libgsm --enable-libopencore-amrnb \
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp \
--enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvpx \
--enable-libvo-amrwbenc --enable-libvo-aacenc --enable-libaacplus --enable-libxavs \
--enable-bzlib --enable-openssl --enable-gnutls --enable-openal --enable-libv4l2 \
--enable-libpulse --enable-libmodplug --enable-libass --enable-libcdio --enable-vdpau --enable-libbluray

After it's done configuring, let's start compiling:

make && make install && ldconfig

After the commands are finished, you are done!

FFmpeg is now installed!


How to remove IDDQD Redirect Malware
// malware, PHP

Website is redirecting to iddqd.compress.to when opened from search engine?

Aww dang, you got infected by a redirect malware affecting PHP files!

Have no worries, I've got the fix for you!

The malware operates like this: If referer is a search engine = redirect to iddqd.compress.to. When accessing by just entering the url, the site works just fine. Pretty cheeky eh?

Most of the 'fixing' scripts pretty much broke everything, removed PHP start tags, etc., so I fiddled around and created this one-liner to enter in a folder where the malware resides:

find . -type f -name "*.php" -exec sed -i 's/eval(base64_decode(.*));//g' {} \;

Tada! Nice and safe!