Not My Idea — Snippets

Some code snippets about Linux / Php and Python

Category: Linux

How to remove all .svn folders recursively ?

SVN is really out of date (if you can, try mercurial or any other DVCS, please!), but if you have to use svn, you’ll probably encountred the .svn folder. It sticks in every folder of your arborescence.
Here is a tip to remove all theses .svn folders, hope this useful !
find . -name ".svn" -exec rm [...]

What do I read ? (RSS Feeds)

<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
    <head>
        <title>Alexis Metaireau subscriptions in Google Reader</title>
    </head>
    <body>
        <outline text="Clément Delafargue // Divarvel"
           title="Clément Delafargue // Divarvel" type="rss"
           xmlUrl="http://www.divarvel.fr/rss/" htmlUrl="http://www.divarvel.fr"/>
        <outline text="DLFP – Dépêches de page principale"
  [...]

Using Scribe log server with PHP.

In a previous post, I was talking about howto install Scribe on a debian system.
Now, let’s talk about howto launch the server properly, and how to use it’s functionalities with PHP:
Starting Scribe
I’ve created the /usr/local/scribe/scribe.conf file, with this default content (it will configure scribe to listen port 1463 and write logs to /tmp/scribetest
port=1463
max_msg_per_second=2000000
check_interval=3

# DEFAULT
<store>
category=default
type=buffer

target_write_size=20480
max_write_interval=1
buffer_send_rate=2
retry_interval=30
retry_interval_range=10

<primary>
type=file
fs_type=std
file_path=/tmp/scribetest
base_filename=thisisoverwritten
max_size=1000000
add_newlines=1
</primary>

<secondary>
type=file
fs_type=std
file_path=/tmp
base_filename=thisisoverwritten
max_size=3000000
</secondary>
</store>
Now, start [...]

Howto install « Scribe » (The Facebook log system) on Debian

Here is a simple HOWTO for installing Scribe Server
The quick way
You can install Scribe with all its dependencies by simply copy/paste this line on your terminal.
sudo apt-get install libboost-dev=1.38.1 flex bison libtool automake autoconf pkg-config && wget -O thrift.tgz "http://gitweb.thrift-rpc.org/?p=thrift.git;a=snapshot;h=HEAD;sf=tgz" && tar -xzf thrift.tgz && cd thrift &&./bootstrap.sh && ./configure && make && sudo make [...]

Install Liferea from sources

Recently, I had to install liferea from sources, in order to have the google reader syncronisation.
This is not the last trunk version, but a version that works well on my system.
Here is the steps, on a Ubuntu 9.04 system:
Download / Extract
wget http://sourceforge.net/projects/liferea/files/Liferea%20Unstable/liferea-1.5.10.tar.gz/download
tar -xvzf liferea-1.5.10.tar.gz
Get dependencies
sudo apt-get build-dep liferea
sudo apt-get install -y libcurl4-gnutls-dev libwebkit-dev
Build
cd liferea-1.5.10
./configure
make
sudo make [...]

Tunneling SSH – Proxy Socks5

La petite ligne de commande qu’on à toujours du mal à retenir (en tout cas moi j’y arrive vraiment pas ) …
Pour le proxy Socks5, c’est celle-ci:
ssh -2 -N -f -D 5555 alexis@host -p 80
Et pour binder un port externe sur un autre port interne à notre machine, c’est par là:
ssh -N -f alexis@host [...]