Natjohanhttp://natjohan.info/2016-03-06T13:52:00+01:00Tip of the week 442016-03-06T13:52:00+01:00natjohantag:natjohan.info,2016-03-06:tip-of-the-week-44.html<img alt="" src="/images/Shutter_logo.png" />
<div class="section" id="shutter-feature-rich-screenshot-tool">
<h2>Shutter : feature rich screenshot tool</h2>
<p><a class="reference external" href="http://shutter-project.org/">Shutter</a> is a powerful screenshot tool w/ many features, it allows you
to <strong>capture</strong> (a specific selection/windows/menu/tooltip/website...),
you can easily <strong>edit</strong> your captures with shutter built-in editor
(add text, arrows, crop, highlight,...) and also <strong>share</strong> (flickr, imgur, etc)</p>
<p>To install it under you debian based distribution :</p>
<div class="highlight"><pre><span class="go">~ sudo add-apt-repository ppa:shutter/ppa</span>
<span class="go">~ sudo apt-get update && sudo apt-get install shutter</span>
</pre></div>
<p>Under Fedora :</p>
<div class="highlight"><pre><span class="go">~ yum install shutter</span>
</pre></div>
<p>Just launch <cite>Shutter</cite> and you are ready to go ! Explore the -> <em>edit</em> -> <em>preferences</em>
(folder to save your screenshot, naming, launch at startup, etc) I also highly recommend
to use <cite>Shutter</cite> as default when you type <cite>print screen</cite> touch, to do so just follow this step
by step <a class="reference external" href="http://shutter-project.org/faq-help/set-shutter-as-the-default-screenshot-tool/">guide</a></p>
<img alt="" src="/images/Shutter_edit_tool.png" />
</div>
EncFS : simply protect and access to your private data on cloud services2016-02-08T21:17:00+01:00natjohantag:natjohan.info,2016-02-08:encfs-simply-protect-and-access-to-your-private-data-on-cloud-services.html<img alt="" src="/images/Encfs-global.png" />
<div class="section" id="edit">
<h2>Edit</h2>
<p>First, I published this article three years ago, in 2013. As things moving fast, specially in security, Sebastian Messmer just
advised me that <cite>EncFS</cite> is not a really secure tool anymore to save files on Dropbox. In February 2014, Taylor Hornby a scientist and security researcher done an audit of the EncFS code, and bad news :</p>
<!-- -->
<blockquote>
<em>EncFS is probably safe as long as the adversary only gets one copy of
the ciphertext and nothing more. EncFS is not safe if the adversary
has the opportunity to see two or more snapshots of the ciphertext at
different times. EncFS attempts to protect files from malicious
modification, but there are serious problems with this feature.</em></blockquote>
<p>You can find the whole audit <a class="reference external" href="https://defuse.ca/audits/encfs.htm">online</a> .
That mean <cite>EncFS</cite> is not a good way to secure your Dropbox, as it saves many snapshots of your files. Since this audit, several
versions were released : <a class="reference external" href="https://github.com/vgough/encfs/releases">https://github.com/vgough/encfs/releases</a> , but unfortunately, all issues are not fixed <a class="reference external" href="https://github.com/vgough/encfs/issues/9">yet</a>. So Sebastian built his own crypto tool named Cryfs, it alreadydo the job, even if it's not user-friendly and cross platform yet, but that's a young tool. You can find a comparison of the market : <a class="reference external" href="https://www.cryfs.org/comparison">https://www.cryfs.org/comparison</a> and if you're interested in crypto, you can also read the Sebastian's <a class="reference external" href="https://www.cryfs.org/cryfs_mathesis.pdf">thesis</a> about cryfs.</p>
<p><strong>Lesson learned :</strong> don't use the current encfs (1.8) version to protect your files on Dropbox, Open Source allows users to edit the code freely and thus increase the level of security for users of this code.</p>
</div>
<div class="section" id="synopsis">
<h2>Synopsis</h2>
<p>Nowadays, there is many cloud storage services (Dropbox, Bitcasa, Box, Hubic, Mega, Drive, Sparkleshare, etc) to sync/backup/share/copy your data. Thanks to it, you can prevent hard drive crash or access it from different devices.</p>
<p>Use a third-parties cloud providers mean you have to trust them and there is <strong>few questions</strong> :</p>
<div class="line-block">
<div class="line">Do you want to put your <strong>private</strong> data in da cloud ?</div>
<div class="line">Have you ever read <strong>termes of use</strong> for this services ? (Are you sure ?!)</div>
<div class="line">How does the service provide <strong>authentication</strong> ?</div>
<div class="line">Which technology protect your data ? Is there an <strong>encryption</strong> system (in transit and storage) ?</div>
<div class="line">What will happen to your data if you decide to <strong>close your account</strong> ?</div>
<div class="line">Are there <strong>penalties</strong> ($) for unwanted access to your data ?</div>
<div class="line">Is it <strong>vulnerable</strong> to security breaches ?</div>
</div>
<p>If you hesitate or can't answer at one or more question, you have to consider to use EncFS to <strong>add a new layer of security for your private data</strong>. Moreover, according to the Fraunhofer institut report about cloud services (see <cite>Go further</cite> links) :</p>
<p><em>The results of the cloud storage provider analysis made clear that most, but not all, cloud storage providers offer built-in methods to encrypt the data to be stored in the cloud. However, the encryption schemes are sometimes not sufficient, as some storage providers encrypt data by using an encryption key generated by and stored at the provider. This means that users cannot be sure wether the storage provider also uses the key to decrypt their data, access the contents and possibly pass it on
to third-parties. Even worse, some cloud storage providers do not encrypt data at all.</em></p>
</div>
<div class="section" id="encfs-in-a-nutshell">
<h2>EncFS in a nutshell</h2>
<p>EncFS is an encrypted virtual filesystem which provides a local directory based encryption. It works with <a class="reference external" href="http://en.wikipedia.org/wiki/Filesystem_in_Userspace">FUSE</a> which mean : you don't have to get any privilege to make it works and you can access it through your filesystem (because EncFS is a virtual filesystem : VFS).</p>
<div class="section" id="encrypt-settings">
<h3>Encrypt Settings</h3>
<p>In <cite>paranoia</cite> mode:</p>
<blockquote>
<div class="line-block">
<div class="line">Cipher: AES</div>
<div class="line">Key Size: 256 bits</div>
<div class="line">PBKDF2 with 3 second runtime, 160 bit salt</div>
<div class="line">Filesystem Block Size: 1024 bytes</div>
<div class="line">Filename Encoding: Block encoding with IV chaining</div>
<div class="line">Unique initialization vector file headers</div>
<div class="line">Message Authentication Code block headers</div>
<div class="line">External IV Chaining</div>
</div>
</blockquote>
<!-- Note : you should read `disadvantages section <http://www.arg0.net/encfsintro>`_ on the official website -->
</div>
<div class="section" id="why-encfs">
<h3>Why EncFS ?</h3>
<p>EncFS offer a <strong>good level of protection for personal use</strong> (see above)</p>
<p>EncFS is <strong>simple to use</strong></p>
<p>EncFS encrypt one file at a time, and not on an entire block device (like TrueCrypt) and it's very cool for cloud storage, because you just update your modified files. Moreover you don't have to define a size for your encrypted folder</p>
<p>EncFS can works on many OS and there is GUI (see below)</p>
</div>
</div>
<div class="section" id="linux">
<h2>Linux</h2>
<div class="section" id="installation">
<h3>Installation</h3>
<p>On Fedora (there is also a debian or freebsd <a class="reference external" href="http://www.arg0.net/encfs">packages</a>) :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install fuse-encfs</span>
</pre></div>
</div>
<div class="section" id="usage">
<h3>Usage</h3>
<div class="section" id="from-command-line">
<h4>From command line</h4>
<p>You can use Encfs from the command line, the following command create an encrypted folder where your data will be stored and a folder and an other folder for your decrypted data :</p>
<div class="highlight"><pre><span class="go">natjohan $ encfs /home/.myencryptedfolder /home/mydecryptedfoler</span>
</pre></div>
<p>Then follow the instructions (select p for paranoia mode, choose a very strong password and of course, don't forget it ;)</p>
<p>You can verify with :</p>
<div class="highlight"><pre><span class="go">natjohan $ cat /proc/mounts</span>
<span class="go"> encfs /home/mydecryptedfoler fuse rw,nosuid,nodev,user_id=1000,group_id=1000,default_permissions 0 0</span>
</pre></div>
<p>You should see an encfs line.</p>
<p>So, to use EncFS and show/put your data in your <cite>mydecryptedfoler</cite> you just have to recall :</p>
<div class="highlight"><pre><span class="go">natjohan $ encfs /home/.myencryptedfolder /home/mydecryptedfoler</span>
</pre></div>
<p>Each data in this folder will be encrypted in your <cite>.myencryptedfolder</cite>.</p>
<p>To umount the folder :</p>
<div class="highlight"><pre><span class="go">natjohan $ fusermount -u /home/mydecryptedfolder</span>
</pre></div>
<p>To change your password :</p>
<div class="highlight"><pre><span class="go">natjohan $ encfsctl passwd /home/.myencryptedfolder</span>
</pre></div>
<!-- /!\\ Note : **Don't remove /.myencryptedfolder/.encfs6.xml file and save it**, without this file you can't decrypt your data ! **Make sure you remember the password too**, because there is no way to recover your data if you forget the password ! -->
</div>
<div class="section" id="with-a-gui">
<h4>Ŵith a GUI</h4>
<p>There is also a GUI for Encfs called <a class="reference external" href="http://tom.noflag.org.uk/cryptkeeper.html">CryptKeeper</a>, you can build it from source or on Fedora :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install cryptkeeper</span>
</pre></div>
<p>CryptKeeper offer a simple GUI thanks to a system tray applet, you can mount/umount or create encrypted folders.</p>
<img alt="" src="/images/CryptKeeper.png" />
<p>There is also some options (with a right clic on the icon). So, the content of your encrypted folder should looks like this :</p>
<img alt="" src="/images/Enc-content.png" />
</div>
</div>
</div>
<div class="section" id="android">
<h2>Android</h2>
<p>"Ok, Encfs is pretty cool, but if I want to access to my data on my android device ?!"
There is several android apps for decrypt Encfs folder, but CloudFetch is my favorite, you can decrypt local folder or directly link it with Dropbox, SpiderOak, SparkleShare and Ubuntu One (for the moment). Download it via Google play <a class="reference external" href="https://play.google.com/store/apps/details?id=az.cloudfetch">here</a></p>
<img alt="" src="/images/CloudFetch.png" />
<!-- Note : This app is free but unfortunately the code is no longer open source -->
</div>
<div class="section" id="windows">
<h2>Windows</h2>
<p>"On my family's computer ?"</p>
<div class="section" id="id1">
<h3>Installation</h3>
<p>So, you need the dokan library, it allows to run a FUSE filesystem on windows. Just download and install <a class="reference external" href="http://dokan-dev.net/en/download/">the dokan library</a>. Then there is an EncFS port named <strong>EncFS4win</strong> : download the <a class="reference external" href="http://members.ferrara.linux.it/freddy77/encfs.html">archive</a> and you can extract it anywhere you want (ex: <cite>C:Program Filesencfs</cite>).</p>
</div>
<div class="section" id="id2">
<h3>Usage</h3>
<p>To launch the GUI, just double click <cite>encfsw.exe</cite> and now you can easily manage your encrypted folders.</p>
<img alt="" src="/images/Encfs4win.png" />
<!-- Note for Win 8 users : you have to launch in compatibility mode (right clic -> propriety -> compatibility and set win 7) -->
</div>
</div>
<div class="section" id="os-x-lion">
<h2>Os X Lion</h2>
<p>I'm not a mac user but i found a solution for you on <a class="reference external" href="http://webdiary.com/2011/11/25/dropsec/">webdiary</a> : you have to download and install <a class="reference external" href="http://fuse4x.github.com/">Fuse4x</a> to support FUSE and the EncFS mac installer on <a class="reference external" href="http://www.lisanet.de/?p=128">lisanet</a>. Now you can use EncFS in command line.</p>
<p>If you want a GUI, just follow this quick <a class="reference external" href="http://www.alexwhittemore.com/encfs-on-lion-in-5-minutes/">howto</a> (you need to install homebrew)</p>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<div class="line-block">
<div class="line">EncFS official <a class="reference external" href="http://www.arg0.net/encfs">website</a></div>
<div class="line">EncFS on <a class="reference external" href="http://en.wikipedia.org/wiki/EncFS">wikipedia</a></div>
<div class="line">Very interesting EncFS <a class="reference external" href="http://www.ict.griffith.edu.au/anthony/info/crypto/encfs.hints">hints</a></div>
<div class="line">A pdf report from Fraunhofer institut : <a class="reference external" href="http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CD0QFjAA&url=http%3A%2F%2Fwww.sit.fraunhofer.de%2Fcontent%2Fdam%2Fsit%2Fen%2Fstudies%2FCloud-Storage-Security_a4.pdf&ei=nzf8UP62HdKIhQf6oIFw&usg=AFQjCNGhymnIFCQOFJaXrWI8elG_3cirCA&sig2=V_kMG85r96f2hxpX5s8bqw&bvm=bv.41248874,d.ZG4">On the security of cloud storage services</a></div>
</div>
</div>
Tip of the week 432015-10-03T18:29:00+02:00natjohantag:natjohan.info,2015-10-03:tip-of-the-week-43.html<img alt="" src="/images/prey-logo.png" />
<div class="section" id="protect-your-computer-against-theft-with-prey">
<h2>Protect your computer against theft with Prey</h2>
<p>Everyday, a ton of electronic devices are stolen in the world, and it does
not only happen to others, and you should protect your devices. That's why
I just tested Prey and I think it's quite a good solution.</p>
<p>As the official website says :</p>
<!-- -->
<blockquote>
<strong>Prey</strong> lets you keep track of your laptop, phone and tablet whenever missing,
whether you're in town or abroad. Open source, proven software with hundreds
of documented recoveries all around the world.</blockquote>
<p>It's a multi-platform open source software that allows you to track your personal devices.
You can use the Prey platform (I mean website) which is really good to track your device or
you can set up your own control panel from this <a class="reference external" href="https://github.com/prey/prey-standalone-control-panel">project</a>.</p>
<p>Prey is free up to tree devices, you can also subscribe for a pro plan which have
some advanced features (more reports, accelerated tracking, delete files remotely etc).
But, note that you can subscribe it whenever you need.</p>
</div>
<div class="section" id="installation-under-ubuntu-elementaryos">
<h2>Installation under Ubuntu/ElementaryOs</h2>
<p>Before the installation, you should activate the <cite>universe</cite> Ubuntu repository
in your <cite>/etc/apt/sources.list</cite> as <cite>Prey</cite> needs some dependencies (scrot, streamer, mpg123 ),
so simply edit this file and add or uncomment the following lines :</p>
<div class="highlight"><pre><span class="go">// /etc/apt/sources.list</span>
<span class="go">deb http://fr.archive.ubuntu.com/ubuntu/ precise universe</span>
<span class="go">deb-src http://fr.archive.ubuntu.com/ubuntu/ precise universe</span>
<span class="go">deb http://fr.archive.ubuntu.com/ubuntu/ precise-updates universe</span>
<span class="go">deb-src http://fr.archive.ubuntu.com/ubuntu/ precise-updates universe</span>
</pre></div>
<p>Then run an <cite>aptitude update</cite>/<cite>apt-get update</cite>, download the deb file from
the Prey website <a class="reference external" href="https://preyproject.com/download">here</a> and launch the installation with your package manager.</p>
<img alt="" src="/images/prey-start.png" />
<p>Prey will ask you to create or use a Prey account in order to track your device.
And that's all, you can now track your device from the Prey <a class="reference external" href="https://panel.preyproject.com">website</a>, and you can
test it !</p>
<p>PS : hope that you don't have to use it ;-)</p>
<img alt="" src="/images/prey-msg.png" />
<img alt="" src="/images/prey-panel.png" />
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<p>I also tested it on my Samsung Galaxy S3 without problems.</p>
</div>
Tip of the week 422015-09-19T13:52:00+02:00natjohantag:natjohan.info,2015-09-19:tip-of-the-week-42.html<div class="section" id="use-the-ip-command-under-linux">
<h2>Use the <cite>ip</cite> command under linux</h2>
<p>As you know (or not) the <cite>ifconfig</cite> command is deprecated since many years now and not developped anymore since 2001,
it's still present but for now you should use the <cite>ip</cite> command which is a part of the <cite>iproute2</cite> package,
it supports all functions of <cite>ifconfig</cite>, <cite>route</cite>, <cite>arp</cite>, <cite>netstat</cite> and many others (multicast, tunnels,
etc)</p>
<p>Here is the ip command syntax :</p>
<div class="highlight"><pre><span class="go">~ ip help</span>
<span class="go">Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }</span>
<span class="go"> ip [ -force ] -batch filename</span>
<span class="go">where OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |</span>
<span class="go"> tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |</span>
<span class="go"> netns }</span>
<span class="go"> OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |</span>
<span class="go"> -f[amily] { inet | inet6 | ipx | dnet | link } |</span>
<span class="go"> -l[oops] { maximum-addr-flush-attempts } |</span>
<span class="go"> -o[neline] | -t[imestamp] | -b[atch] [filename] |</span>
<span class="go"> -rc[vbuf] [size]}</span>
</pre></div>
<p>Few examples below :</p>
<p>Control the physical and logical state of an interface :</p>
<div class="highlight"><pre><span class="go">~ sudo ip link set wlan0 up</span>
</pre></div>
<p>Set up an IP address (yes you can use CIDR notation):</p>
<div class="highlight"><pre><span class="go">~ ip addr add 192.168.2.1/24 dev eth0</span>
</pre></div>
<p>Return the IP addresses :</p>
<div class="highlight"><pre><span class="go">~ ip addr</span>
<span class="go">1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN</span>
<span class="go"> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</span>
<span class="go"> inet 127.0.0.1/8 scope host lo</span>
<span class="go"> valid_lft forever preferred_lft forever</span>
<span class="go"> inet6 ::1/128 scope host</span>
<span class="go"> valid_lft forever preferred_lft forever</span>
<span class="go">2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000</span>
<span class="go"> link/ether e8:03:9a:b2:a4:11 brd ff:ff:ff:ff:ff:ff</span>
<span class="go">3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000</span>
<span class="go"> link/ether c4:85:08:1b:f4:04 brd ff:ff:ff:ff:ff:ff</span>
<span class="go"> inet 192.168.1.25/24 brd 192.168.1.255 scope global wlan0</span>
<span class="go"> valid_lft forever preferred_lft forever</span>
<span class="go"> inet6 fe80::c685:8ff:fe1b:f404/64 scope link</span>
<span class="go"> valid_lft forever preferred_lft forever</span>
</pre></div>
<p>Display the routing table</p>
<div class="highlight"><pre><span class="go">~ ip route</span>
<span class="go">default via 192.168.1.1 dev wlan0 proto static</span>
<span class="go">169.254.0.0/16 dev wlan0 scope link metric 1000</span>
<span class="go">172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.42.1</span>
<span class="go">192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.25 metric 2</span>
</pre></div>
<p>Display a routing entry for a specific subnet :</p>
<div class="highlight"><pre><span class="go"> ~ ip ro get 8.8.8.8</span>
<span class="go">8.8.8.8 via 192.168.1.1 dev wlan0 src 192.168.1.25</span>
<span class="go"> cache</span>
</pre></div>
<p>Show ARP entries :</p>
<div class="highlight"><pre><span class="go">~ ip neighbor</span>
<span class="go">192.168.1.1 dev wlan0 lladdr 2c:39:96:2a:2f:9c REACHABLE</span>
<span class="go">fe80::2e39:96ff:fe2a:2f9c dev wlan0 lladdr 2c:39:96:2a:2f:9c router DELAY</span>
</pre></div>
<p>Show link statistics :</p>
<div class="highlight"><pre><span class="go">~ ip -s link</span>
<span class="go">1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN</span>
<span class="go"> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</span>
<span class="go"> RX: bytes packets errors dropped overrun mcast</span>
<span class="go"> 54244 563 0 0 0 0</span>
<span class="go"> TX: bytes packets errors dropped carrier collsns</span>
<span class="go"> 54244 563 0 0 0 0</span>
<span class="go">2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000</span>
<span class="go"> link/ether e8:03:9a:b2:a4:11 brd ff:ff:ff:ff:ff:ff</span>
<span class="go"> RX: bytes packets errors dropped overrun mcast</span>
<span class="go"> 0 0 0 0 0 0</span>
<span class="go"> TX: bytes packets errors dropped carrier collsns</span>
<span class="go"> 0 0 0 0 0 0</span>
<span class="go">3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000</span>
<span class="go"> link/ether c4:85:08:1b:f4:04 brd ff:ff:ff:ff:ff:ff</span>
<span class="go"> RX: bytes packets errors dropped overrun mcast</span>
<span class="go"> 5185017 6229 0 0 0 0</span>
<span class="go"> TX: bytes packets errors dropped carrier collsns</span>
<span class="go"> 1178874 4200 0 0 0 0</span>
</pre></div>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<div class="line-block">
<div class="line"><a class="reference external" href="http://lartc.org/manpages/ip.txt">man</a></div>
<div class="line"><a class="reference external" href="http://lartc.org/howto/">lartc</a></div>
</div>
</div>
Tip of the week 412015-03-08T11:39:00+01:00natjohantag:natjohan.info,2015-03-08:tip-of-the-week-41.html<div class="section" id="a-mib-browser-for-linux-qtmib">
<h2>A MIB browser for Linux : qtmib</h2>
<p><cite>qtmib</cite> is a simple and open source MIB browser for Linux based on QT. It supports
SNMP v1 and v2c, network discovery, a lot of built-in MIBs and you can add
your private MIB also (under <cite>~/.config/qtmib/mibs</cite>).</p>
<p>To install it, simply go on the offical <a class="reference external" href="http://qtmib.sourceforge.net/index.html">website</a> and download the .deb or .rpm
file from <a class="reference external" href="http://sourceforge.net/projects/qtmib/files/">here</a></p>
<img alt="" src="/images/qtmib-report.png" />
</div>
Tip of the week 402015-02-23T21:57:00+01:00natjohantag:natjohan.info,2015-02-23:tip-of-the-week-40.html<div class="section" id="connect-your-linux-local-host-to-your-gns3-s-devices">
<h2>Connect your Linux local host to your GNS3's devices</h2>
<p>Some days ago I tried to connect my GNS3 devices to the outside with the cloud icon
(note that you have to launch GN3 with root rights), it works well but I noticed
that I couldn't reach my local host...
After some investigation, I found an article on the GNS3 FAQ <a class="reference external" href="http://forum.gns3.net/topic18.html">here</a> :</p>
<!-- -->
<blockquote>
<p><strong>On Linux / Unix / OS X, when I bridge a router or switch interface to my local
host I can’t ping it from my host. But this works on Windows? What gives?</strong></p>
<p><em>This does generally work on Windows (depending on your network card)
but not on Linux / Unix. Most likely this is due to differences between
libpcap and Winpcap, and the differences in the network stacks on Unix /
Windows (e.g. NDIS). However you should be able to ping your bridged
interfaces from other systems on the bridged network. If this does
not work on Windows for your particular NIC, try creating a Windows
loopback adapter and bridging to that. On Linux you can use a tap
interface and the NIO_tap (available from a cloud). OS X you can
install tun/tap drivers.</em></p>
</blockquote>
<p>Ok, so I need to create a tap interface, here is how with the <cite>ip</cite> command
(as <cite>ifconfig</cite> is deprecated):</p>
<div class="highlight"><pre><span class="go">~ sudo ip tuntap add tap1 mode tap user root</span>
<span class="go">~ sudo ip link set tap1 up</span>
<span class="go">~ sudo ip addr add 192.0.2.100/24 dev tap1</span>
</pre></div>
<p>Check it with :</p>
<div class="highlight"><pre><span class="go">~ ip addr show tap1</span>
<span class="go">6: tap1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 500</span>
<span class="go"> link/ether ce:d5:8b:bc:5e:74 brd ff:ff:ff:ff:ff:ff</span>
<span class="go"> inet 192.168.2.100/24 scope global tap1</span>
<span class="go"> valid_lft forever preferred_lft forever</span>
<span class="go"> inet 192.0.2.100/24 scope global tap1</span>
<span class="go"> valid_lft forever preferred_lft forever</span>
<span class="go"> inet6 fe80::ccd5:8bff:febc:5e74/64 scope link</span>
<span class="go"> valid_lft forever preferred_lft forever</span>
</pre></div>
<p>Note that the tap1 is in DOWN state because there no carrier.</p>
<p>Create a host under GNS3, right click on it and configure, go
under <cite>NIO TAP</cite> tab and add the tap1 you just created.</p>
<img alt="" src="/images/gns3-tap.png" />
<p>Then, create the link to your device and apply your interface
configuration in order to test the reachability.</p>
<div class="highlight"><pre><span class="go">R1(config)#int ethernet 0/0</span>
<span class="go">R1(config-if)#ip addr</span>
<span class="go">R1(config-if)#ip address 192.0.2.200 255.255.255.0</span>
<span class="go">R1(config-if)#no shut</span>
<span class="go">R1(config-if)#^Z</span>
<span class="go">R1#conf t</span>
<span class="go">*Mar 1 00:00:36.731: %SYS-5-CONFIG_I: Configured from console by console</span>
<span class="go">R1#conf</span>
<span class="go">*Mar 1 00:00:37.699: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up</span>
<span class="go">*Mar 1 00:00:38.699: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up</span>
<span class="go">R1#</span>
<span class="go">R1#</span>
<span class="go">R1#ping 192.0.2.100</span>
<span class="go">Type escape sequence to abort.</span>
<span class="go">Sending 5, 100-byte ICMP Echos to 192.0.2.100, timeout is 2 seconds:</span>
<span class="go">.!!!!</span>
</pre></div>
<p>Now you can reach the router from your Linux. That's interesting if you want for example to test
some supervision tool.</p>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<p>If you want to make your <cite>tap</cite> interface persistent, you have to edit your
<cite>/etc/network/interfaces</cite> file with the following :</p>
<div class="highlight"><pre><span class="go">iface tap1 inet manual</span>
<span class="go">pre-up ip tuntap add tap1 mode tap user root</span>
<span class="go">pre-up ip addr add 192.0.2.100/24 dev tap1</span>
<span class="go">up ip link set dev tap1 up</span>
<span class="go">post-down ip link del dev tap1</span>
</pre></div>
</div>
Install GNS3 1.2 on your Ubuntu from scratch2015-02-22T14:52:00+01:00natjohantag:natjohan.info,2015-02-22:install-gns3-12-on-your-ubuntu-from-scratch.html<img alt="" src="/images/GNS3-logo-new.png" />
<p>Some weeks ago, I published an <a class="reference external" href="http://natjohan.info/install-gns3-10-beta-on-your-ubuntu-from-scratch.html">article</a> in order to install GNS3 beta,
now GNS3 is under 1.2.3 version, so here is an update to install it from scratch on ubuntu/elementaryos :</p>
<div class="section" id="you-need-python-3-3-or-higher-pip-qtmake-and-other-stuff">
<h2>1/ You need python 3.3 or higher, pip, qtmake and other stuff :</h2>
<div class="highlight"><pre><span class="go">~ sudo add-apt-repository ppa:fkrull/deadsnakes</span>
<span class="go">~ sudo aptitude update</span>
<span class="go">~ sudo aptitude install git python3.4 python3.4-dev qt4-qmake qt4-dev-tools libzmq-dev cmake libelf1 libelf-dev uuid-dev libpcap-dev</span>
<span class="go">~ cd /tmp/</span>
<span class="go">~ wget https://bootstrap.pypa.io/get-pip.py</span>
<span class="go">~ sudo python3.4 get-pip.py</span>
</pre></div>
<p>Download SIP, PyQt4 from :
- <a class="reference external" href="http://www.riverbankcomputing.com/software/sip/download">http://www.riverbankcomputing.com/software/sip/download</a>
- <a class="reference external" href="http://www.riverbankcomputing.com/software/pyqt/download">http://www.riverbankcomputing.com/software/pyqt/download</a></p>
<div class="highlight"><pre><span class="go">~ tar xvzf PyQt-x11-gpl-4.11.3.tar.gz</span>
<span class="go">~ tar xvzf sip-4.16.5.tar.gz</span>
<span class="go">~ cd sip-4.16.5/</span>
<span class="go">~ python3.4 configure.py</span>
<span class="go">~ make && sudo make install</span>
<span class="go">~ cd ../PyQt-x11-gpl-4.11.3</span>
<span class="go">~ python3.4 configure.py</span>
<span class="go">~ make && sudo make install</span>
</pre></div>
</div>
<div class="section" id="install-gns3-gui">
<h2>2/ Install gns3-gui</h2>
<div class="highlight"><pre><span class="go">~ cd /tmp/</span>
<span class="go">~ git clone https://github.com/GNS3/gns3-gui.git</span>
<span class="go">~ cd gns3-gui</span>
<span class="go">~ sudo python3.4 setup.py install</span>
</pre></div>
</div>
<div class="section" id="install-dynamips">
<h2>3/ Install Dynamips</h2>
<div class="highlight"><pre><span class="go">~ cd /tmp/</span>
<span class="go">~ git clone https://github.com/GNS3/dynamips.git</span>
<span class="go">~ cd dynamips</span>
<span class="go">~ mkdir build</span>
<span class="go">~ cd build</span>
<span class="go">~ cmake ..</span>
<span class="go">~ make && sudo make install</span>
</pre></div>
</div>
<div class="section" id="install-gns3-server">
<h2>4/ Install gns3-server</h2>
<div class="highlight"><pre><span class="go">~ cd /tmp/</span>
<span class="go">~ git clone https://github.com/GNS3/gns3-server.git</span>
<span class="go">~ cd gns3-server</span>
<span class="go">~ sudo python3.4 setup.py install</span>
</pre></div>
<p>Change the gns-server path in <cite>Edit->Preferences</cite> by <cite>/usr/local/bin/gns3server</cite>
launch GNS3 with <cite>gns3</cite></p>
<p>If you encounter the following issue :
Could not connect to the local server 127.0.0.1 on port 8000: Websocket exception <class 'ws4py.exc.HandshakeError'>: Invalid response status: b'403' b'Forbidden'</p>
<p>Just install Tornado in the following version :</p>
<div class="highlight"><pre><span class="go">~ sudo pip3.4 uninstall tornado</span>
<span class="go">~ sudo pip3.4 install tornado==3.2.2</span>
</pre></div>
</div>
<div class="section" id="bonus">
<h2>5/ Bonus</h2>
<div class="section" id="for-virtualbox-integration">
<h3>For Virtualbox integration :</h3>
<p>(Yes you have to use python2.7)</p>
<div class="highlight"><pre><span class="go">~ cd /tmp</span>
<span class="go">~ git clone https://github.com/GNS3/vboxwrapper.git</span>
<span class="go">~ cd vboxwrapper</span>
<span class="go">~ sudo python2.7 setup.py install</span>
</pre></div>
<p>Then just copying these files :</p>
<div class="highlight"><pre><span class="go">~ sudo cp -r adapters nios vboxwrapper.py tcp_pipe_proxy.py virtualbox_controller.py virtualbox_error.py /usr/local/lib/python2.7/dist-packages</span>
</pre></div>
<p>And now, just edit the vboxwrapper path in gns3 : <cite>Edit->Preferences</cite> with <cite>/usr/local/bin/vboxwrapper</cite></p>
<img alt="" src="/images/GNS3-virtualbox.png" />
</div>
<div class="section" id="iou-integration">
<h3>IOU integration :</h3>
<p>Installing IOU then, download and install iouyap from :
<a class="reference external" href="http://sourceforge.net/projects/gns-3/files/Tools/iouyap.tar.gz/download">http://sourceforge.net/projects/gns-3/files/Tools/iouyap.tar.gz/download</a></p>
<div class="highlight"><pre><span class="go">~ cd /tmp</span>
<span class="go">~ tar zxvf iouyap.tar.gz</span>
<span class="go">~ cp iouyap /usr/local/bin/iouyap</span>
</pre></div>
<p>Now, put correct paths in your gns3 preferences <cite>Edit->Preferences</cite> by <cite>/home/MYUSER/.iourc</cite> and <cite>/usr/local/bin/iouyap</cite></p>
<img alt="" src="/images/GNS3-IOU.png" />
</div>
<div class="section" id="vpcs-integration-virtual-pc">
<h3>VPCs integration (Virtual PC):</h3>
<div class="highlight"><pre><span class="go">~ sudo aptitude install subversion</span>
<span class="go">~ cd /tmp</span>
<span class="go">~ svn checkout svn://svn.code.sf.net/p/vpcs/code/trunk vpcs-code</span>
<span class="go">or download it from : http://sourceforge.net/projects/vpcs/?source=typ_redirect</span>
<span class="go">~ cd vpcs-code/src</span>
<span class="go">~ sudo ./mk.sh</span>
<span class="go">~ sudo mv -f vpcs /usr/bin/vpcs</span>
</pre></div>
<p>And now you can put the correct path <cite>/usr/bin/vpcs</cite> for VPCS in your GNS3 preferences</p>
<img alt="" src="/images/GNS3-VPCS.png" />
</div>
<div class="section" id="gns3-converter">
<h3>GNS3 Converter</h3>
<p>GNS3 Converter allow you to convert your old gns3 files to get it works on the new GNS3 (<a class="reference external" href="http://forum.gns3.net/post35824.html">http://forum.gns3.net/post35824.html</a>) :</p>
<div class="highlight"><pre><span class="go">~ sudo pip3 install gns3-converter</span>
</pre></div>
</div>
<div class="section" id="roxterm">
<h3>Roxterm</h3>
<p>For a multi-tabbed terminal :</p>
<div class="highlight"><pre><span class="go">~ sudo aptitude install roxterm</span>
</pre></div>
<p>Then change your GNS3 settings : <cite>Edit->Preferences->General->Console applications-> Preconfigured commands</cite> and change from <cite>xterm</cite> to <cite>Roxterm</cite></p>
</div>
</div>
<div class="section" id="gns3-desktop-icon">
<h2>GNS3 desktop icon</h2>
<p>Just create a .desktop file :</p>
<div class="highlight"><pre><span class="go">~ sudo vi /usr/share/applications/gns3.desktop</span>
<span class="go">[Desktop Entry]</span>
<span class="go">Version=1.0</span>
<span class="go">Type=Application</span>
<span class="go">Terminal=false</span>
<span class="go">Exec=gns3 %f</span>
<span class="go">Name=GNS3</span>
<span class="go">Comment=GNS3 Graphical Network Simulator</span>
<span class="go">Icon=gns3</span>
<span class="go">Categories=Education;</span>
<span class="go">MimeType=application/x-gns3;</span>
<span class="go">Keywords=simulator;network;netsim;</span>
</pre></div>
</div>
<div class="section" id="upgrade-your-gns3-version-1-2-x-to-1-2-x">
<h2>Upgrade your GNS3 version 1.2.X to 1.2.X</h2>
<p>Simply download the latest version from repository and launch again the installation
(for gns3-gui, gns3-server, dynamips) :</p>
<div class="highlight"><pre><span class="go">// gns3-gui</span>
<span class="go">~ cd /tmp/</span>
<span class="go"> ~ git clone https://github.com/GNS3/gns3-server.git</span>
<span class="go"> ~ cd gns3-server</span>
<span class="go"> ~ sudo python3.4 setup.py install</span>
<span class="go">// dynamips</span>
<span class="go">~ cd /tmp/</span>
<span class="go"> ~ git clone https://github.com/GNS3/dynamips.git</span>
<span class="go"> ~ cd dynamips</span>
<span class="go"> ~ mkdir build</span>
<span class="go"> ~ cd build</span>
<span class="go"> ~ cmake ..</span>
<span class="go"> ~ make && sudo make install</span>
<span class="go">// gns3-server</span>
<span class="go">~ cd /tmp/</span>
<span class="go"> ~ git clone https://github.com/GNS3/gns3-server.git</span>
<span class="go"> ~ cd gns3-server</span>
<span class="go"> ~ sudo python3.4 setup.py install</span>
</pre></div>
</div>
Tip of the week 392015-02-21T14:51:00+01:00natjohantag:natjohan.info,2015-02-21:tip-of-the-week-39.html<div class="section" id="a-command-line-tool-for-your-networking-calc-sipcalc">
<h2>A command line tool for your networking calc : sipcalc</h2>
<p>I just want to show you a useful tool for your networking calc called sipcalc,
to install it (under debian based, but it should also exists in your favorite distro) :</p>
<div class="highlight"><pre><span class="go">sudo aptitude install sipcalc</span>
</pre></div>
<p>Some examples, here in IPv4 format :</p>
<div class="highlight"><pre><span class="go">~ sipcalc 192.0.2.0/24</span>
<span class="go">-[ipv4 : 192.0.2.0/24] - 0</span>
<span class="go">[CIDR]</span>
<span class="go">Host address - 192.0.2.0</span>
<span class="go">Host address (decimal) - 3221225984</span>
<span class="go">Host address (hex) - C0000200</span>
<span class="go">Network address - 192.0.2.0</span>
<span class="go">Network mask - 255.255.255.0</span>
<span class="go">Network mask (bits) - 24</span>
<span class="go">Network mask (hex) - FFFFFF00</span>
<span class="go">Broadcast address - 192.0.2.255</span>
<span class="go">Cisco wildcard - 0.0.0.255</span>
<span class="go">Addresses in network - 256</span>
<span class="go">Network range - 192.0.2.0 - 192.0.2.255</span>
<span class="go">Usable range - 192.0.2.1 - 192.0.2.254</span>
</pre></div>
<p>You can also split a network with the <cite>-s</cite> option :</p>
<div class="highlight"><pre><span class="go">~ sipcalc 192.0.2.0/24 -s 28</span>
<span class="go">-[ipv4 : 192.0.2.0/24] - 0</span>
<span class="go">[Split network]</span>
<span class="go">Network - 192.0.2.0 - 192.0.2.15</span>
<span class="go">Network - 192.0.2.16 - 192.0.2.31</span>
<span class="go">Network - 192.0.2.32 - 192.0.2.47</span>
<span class="go">Network - 192.0.2.48 - 192.0.2.63</span>
<span class="go">Network - 192.0.2.64 - 192.0.2.79</span>
<span class="go">Network - 192.0.2.80 - 192.0.2.95</span>
<span class="go">Network - 192.0.2.96 - 192.0.2.111</span>
<span class="go">Network - 192.0.2.112 - 192.0.2.127</span>
<span class="go">Network - 192.0.2.128 - 192.0.2.143</span>
<span class="go">Network - 192.0.2.144 - 192.0.2.159</span>
<span class="go">Network - 192.0.2.160 - 192.0.2.175</span>
<span class="go">Network - 192.0.2.176 - 192.0.2.191</span>
<span class="go">Network - 192.0.2.192 - 192.0.2.207</span>
<span class="go">Network - 192.0.2.208 - 192.0.2.223</span>
<span class="go">Network - 192.0.2.224 - 192.0.2.239</span>
<span class="go">Network - 192.0.2.240 - 192.0.2.255</span>
</pre></div>
<p>for IPv6 :</p>
<div class="highlight"><pre><span class="go">~ sipcalc 2001:DB8::/32</span>
<span class="go">-[ipv6 : 2001:DB8::/32] - 0</span>
<span class="go">[IPV6 INFO]</span>
<span class="go">Expanded Address - 2001:0db8:0000:0000:0000:0000:0000:0000</span>
<span class="go">Compressed address - 2001:db8::</span>
<span class="go">Subnet prefix (masked) - 2001:db8:0:0:0:0:0:0/32</span>
<span class="go">Address ID (masked) - 0:0:0:0:0:0:0:0/32</span>
<span class="go">Prefix address - ffff:ffff:0:0:0:0:0:0</span>
<span class="go">Prefix length - 32</span>
<span class="go">Address type - Aggregatable Global Unicast Addresses</span>
<span class="go">Network range - 2001:0db8:0000:0000:0000:0000:0000:0000 -</span>
<span class="go"> 2001:0db8:ffff:ffff:ffff:ffff:ffff:ffff</span>
</pre></div>
<p>Don't forget to read the manual or display the help with '-h' argument.</p>
<!-- -->
<blockquote>
Note that I used standard IANA IP for documentation in these examples, you can find
it int <a class="reference external" href="https://tools.ietf.org/html/rfc5737">RFC5737</a> for IPv4 and <a class="reference external" href="https://tools.ietf.org/html/rfc3849">RFC3849</a> for IPV6</blockquote>
</div>
Tip of the week 382014-11-02T22:52:00+01:00natjohantag:natjohan.info,2014-11-02:tip-of-the-week-38.html<img alt="" src="/images/cyanogenmod.png" />
<div class="section" id="install-cyanogenmod-11-on-your-samsung-galaxy-s3-i9300-from-elementaryos-ubuntu">
<h2>Install CyanogenMod 11 on your Samsung Galaxy S3 (i9300) from ElementaryOs/Ubuntu</h2>
<p>This process is well tested on Ubuntu 12.04 (ElementaryOs), but it's the same approach in other distros</p>
<div class="section" id="download-cyanogenmod-image-for-your-phone">
<h3>Download CyanogenMod image for your phone</h3>
<p>Just go <a class="reference external" href="http://download.cyanogenmod.org/?device=i9300">here</a> and select your image to download. For the Samung Galaxy S3, I suggest to chose the latest snapshot which is more stable than the nightly builds.</p>
</div>
<div class="section" id="install-heimdall">
<h3>Install Heimdall</h3>
<p><em>Heimdall_ is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung mobile devices.</em></p>
<p>Installing Heimdall (no need the frontend part) :</p>
<div class="highlight"><pre><span class="gp">$</span> sudo apt-get install libusb-1.0-0-dev
</pre></div>
<p>Download <cite>ubuntu12.10-heimdall_1.4.0-0_amd64.deb</cite> from <a class="reference external" href="https://bitbucket.org/benjamin_dobell/heimdall/downloads">https://bitbucket.org/benjamin_dobell/heimdall/downloads</a>
and install it with <cite>dpkg</cite> (install with sudo <cite>aptitude install dpkg</cite> if needed)</p>
<div class="highlight"><pre><span class="gp">$</span> sudo dpkg -i ubuntu12.10-heimdall_1.4.0-0_amd64.deb
</pre></div>
</div>
<div class="section" id="let-s-go">
<h3>Let's go !</h3>
<p>Just boot your Galaxy S3 i9300 in download mode :</p>
<div class="line-block">
<div class="line">- Power off your Galaxy</div>
<div class="line">- Boot the Galaxy S3 into download mode. <strong>Hold Home, Volume Down & Power</strong>. Accept the disclaimer on the device.</div>
<div class="line">- Insert the USB cable into the device.</div>
</div>
<p>Download ClockWorkMod Recovery from <a class="reference external" href="http://clockworkmod.com/rommanager">http://clockworkmod.com/rommanager</a> (which is a ROM manager and installer)</p>
<p>Link for Galaxy S3 : <a class="reference external" href="http://download2.clockworkmod.com/recoveries/recovery-clockwork-6.0.4.6-i9300.img">http://download2.clockworkmod.com/recoveries/recovery-clockwork-6.0.4.6-i9300.img</a></p>
<p>As CyanogenMod came without Google Apps, if you need them, just download it from <a class="reference external" href="http://wiki.cyanogenmod.org/w/Google_Apps">http://wiki.cyanogenmod.org/w/Google_Apps</a></p>
<p>Now launch Heimdall in command line (replace <em>recovery-clockwork-6.0.4.6-i9300.img</em> with the image that you just downloaded) :</p>
<!-- -->
<blockquote>
<strong>Note</strong> that sometimes Heimdall command line output some errors like :
<em>libusb:error [op_open] open failed, code -1 errno 5</em>
<em>ERROR: Failed to access device. libusb error: -1</em>
Just unplug/plug your phone and retry, it should be okay after several attempts</blockquote>
<div class="line-block">
<div class="line"><br /></div>
</div>
<div class="highlight"><pre><span class="gp">$</span> sudo heimdall flash --RECOVERY recovery-clockwork-6.0.4.6-i9300.img
<span class="go">Heimdall v1.4.0</span>
<span class="go">Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna</span>
<span class="go">http://www.glassechidna.com.au/</span>
<span class="go">This software is provided free of charge. Copying and redistribution is</span>
<span class="go">encouraged.</span>
<span class="go">If you appreciate this software and you would like to support future</span>
<span class="go">development please consider donating:</span>
<span class="go">http://www.glassechidna.com.au/donate/</span>
<span class="go">Initialising connection...</span>
<span class="go">Detecting device...</span>
<span class="go">Claiming interface...</span>
<span class="go">Attempt failed. Detaching driver...</span>
<span class="go">Claiming interface again...</span>
<span class="go">Setting up interface...</span>
<span class="go">Initialising protocol...</span>
<span class="go">Protocol initialisation successful.</span>
<span class="go">Beginning session...</span>
<span class="go">Some devices may take up to 2 minutes to respond.</span>
<span class="go">Please be patient!</span>
<span class="go">Session begun.</span>
<span class="go">Downloading device's PIT file...</span>
<span class="go">PIT file download successful.</span>
<span class="go">Uploading RECOVERY</span>
<span class="go">100%</span>
<span class="go">RECOVERY upload successful</span>
<span class="go">Ending session...</span>
<span class="go">Rebooting device...</span>
<span class="go">Releasing device interface...</span>
<span class="go">Re-attaching kernel driver..</span>
</pre></div>
<dl class="docutils">
<dt>You phone should reboot, Be sure to reboot into recovery <strong>immediately</strong> after having installed the custom recovery (remove your battery for example). Otherwise the custom recovery will be overwritten and the device will reboot (appearing as though your custom recovery failed to install)</dt>
<dd>=> <strong>Hold Home, Volume Up & Power</strong></dd>
</dl>
<p>Normally you should see the ClockWorkMod logo (see under) with a menu</p>
<img alt="" src="/images/rommanager-icon.png" />
<p>You can backup your actual system if you want
Now Select <cite>wipe data/factory reset</cite></p>
<p>Next, you have to install <cite>adb</cite> (Android Debug Bridge, it's a tool that allow you to open a terminal on your phone from an usb link) in order to put our zip files on your phone</p>
<div class="highlight"><pre><span class="gp">$</span> sudo add-apt-repository ppa:nilarimogard/webupd8
<span class="gp">$</span> sudo apt-get update
<span class="gp">$</span> sudo apt-get install android-tools-adb android-tools-fastboot
</pre></div>
<p>Plug your phone on your computer and launch an <cite>adb</cite> shell :</p>
<div class="highlight"><pre><span class="gp">$</span> sudo adb shell
</pre></div>
<p>If you see a shell and you can execute command like ls, that's ok, just exit and under ClockWorkMod on your device just go under <cite>install zip</cite> => <cite>install zip from sideload</cite></p>
<p>On your terminal launch :</p>
<div class="highlight"><pre><span class="gp">$</span> sudo adb sideload cm-11-20140916-SNAPSHOT-M10-i9300.zip
</pre></div>
<p>It will install the CyanogenMod ROM, just follow the same process for Google Apps (<cite>install zip</cite> => <cite>install zip from sideload</cite>) :</p>
<div class="highlight"><pre><span class="gp">$</span> sudo adb sideload gapps-kk-20140606-signed.zip
</pre></div>
</div>
</div>
Install GNS3 1.0 beta on your Ubuntu from scratch2014-08-25T19:20:00+02:00natjohantag:natjohan.info,2014-08-25:install-gns3-10-beta-on-your-ubuntu-from-scratch.html<img alt="" src="/images/GNS3-logo-new.png" />
<p>Some weeks ago, GNS3 released its beta version, here is the way to install it from scratch on ubuntu/elementaryos :</p>
<div class="section" id="you-need-python-3-3-or-higher-pip-qtmake-and-other-stuff">
<h2>1/ You need python 3.3 or higher, pip, qtmake and other stuff :</h2>
<div class="highlight"><pre><span class="go">~ sudo add-apt-repository ppa:fkrull/deadsnakes</span>
<span class="go">~ sudo aptitude update</span>
<span class="go">~ sudo aptitude install git python3.4 python3.4-dev qt4-qmake qt4-dev-tools libzmq-dev cmake libelf1 libelf-dev uuid-dev libpcap-dev</span>
<span class="go">~ cd /tmp/</span>
<span class="go">~ wget http://python-distribute.org/distribute_setup.py</span>
<span class="go">~ sudo python3.4 distribute_setup.py</span>
<span class="go">~ sudo easy_install-3.4 pip</span>
<span class="go">~ wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python3.4</span>
</pre></div>
<p>Download SIP, PyQt4 from :
- <a class="reference external" href="http://www.riverbankcomputing.com/software/sip/download">http://www.riverbankcomputing.com/software/sip/download</a>
- <a class="reference external" href="http://www.riverbankcomputing.com/software/pyqt/download">http://www.riverbankcomputing.com/software/pyqt/download</a></p>
<div class="highlight"><pre><span class="go">~ tar xvzf PyQt-x11-gpl-4.11.1.tar.gz</span>
<span class="go">~ tar xvzf sip-4.16.2.tar.gz</span>
<span class="go">~ cd sip-4.16.2/</span>
<span class="go">~ python3.4 configure.py</span>
<span class="go">~ make && sudo make install</span>
<span class="go">~ cd ../PyQt-x11-gpl-4.11.1</span>
<span class="go">~ python3.4 configure.py</span>
<span class="go">~ make && sudo make install</span>
</pre></div>
</div>
<div class="section" id="install-gns3-gui">
<h2>2/ Install gns3-gui</h2>
<div class="highlight"><pre><span class="go">~ cd /tmp/</span>
<span class="go">~ git clone https://github.com/GNS3/gns3-gui.git</span>
<span class="go">~ cd gns3-gui</span>
<span class="go">~ sudo python3.4 setup.py install</span>
</pre></div>
</div>
<div class="section" id="install-dynamips">
<h2>3/ Install Dynamips</h2>
<div class="highlight"><pre><span class="go">~ cd /tmp/</span>
<span class="go">~ git clone https://github.com/GNS3/dynamips.git</span>
<span class="go">~ cd dynamips</span>
<span class="go">~ mkdir build</span>
<span class="go">~ cd build</span>
<span class="go">~ cmake ..</span>
<span class="go">~ make && sudo make install</span>
</pre></div>
</div>
<div class="section" id="install-gns3-server">
<h2>4/ Install gns3-server</h2>
<div class="highlight"><pre><span class="go">~ cd /tmp/</span>
<span class="go">~ git clone https://github.com/GNS3/gns3-server.git</span>
<span class="go">~ cd gns3-server</span>
<span class="go">~ sudo python3.4 setup.py install</span>
</pre></div>
<p>Change the gns-server path in <cite>Edit->Preferences</cite> by <cite>/usr/local/bin/gns3server</cite>
launch GNS3 with <cite>gns3</cite></p>
<p>If you encounter the following issue :
Could not connect to the local server 127.0.0.1 on port 8000: Websocket exception <class 'ws4py.exc.HandshakeError'>: Invalid response status: b'403' b'Forbidden'</p>
<p>Just install Tornado in the following version :</p>
<div class="highlight"><pre><span class="go">~ sudo pip3.4 uninstall tornado</span>
<span class="go">~ sudo pip3.4 install tornado==3.2.2</span>
</pre></div>
</div>
<div class="section" id="bonus">
<h2>5/ Bonus</h2>
<div class="section" id="for-virtualbox-integration">
<h3>For Virtualbox integration :</h3>
<p>(Yes you have to use python2.7)</p>
<div class="highlight"><pre><span class="go">~ cd /tmp</span>
<span class="go">~ git clone https://github.com/GNS3/vboxwrapper.git</span>
<span class="go">~ cd vboxwrapper</span>
<span class="go">~ sudo python2.7 setup.py install</span>
</pre></div>
<p>Then just copying these files :</p>
<div class="highlight"><pre><span class="go">~ sudo cp -r adapters nios vboxwrapper.py tcp_pipe_proxy.py virtualbox_controller.py virtualbox_error.py /usr/local/lib/python2.7/dist-packages</span>
</pre></div>
<p>And now, just edit the vboxwrapper path in gns3 : <cite>Edit->Preferences</cite> with <cite>/usr/local/bin/vboxwrapper</cite></p>
<img alt="" src="/images/GNS3-virtualbox.png" />
</div>
<div class="section" id="iou-integration">
<h3>IOU integration :</h3>
<p>Installing IOU then, download and install iouyap from :
<a class="reference external" href="http://sourceforge.net/projects/gns-3/files/Tools/iouyap.tar.gz/download">http://sourceforge.net/projects/gns-3/files/Tools/iouyap.tar.gz/download</a></p>
<div class="highlight"><pre><span class="go">~ cd /tmp</span>
<span class="go">~ tar zxvf iouyap.tar.gz</span>
<span class="go">~ cp iouyap /usr/local/bin/iouyap</span>
</pre></div>
<p>Now, put correct paths in your gns3 preferences <cite>Edit->Preferences</cite> by <cite>/home/MYUSER/.iourc</cite> and <cite>/usr/local/bin/iouyap</cite></p>
<img alt="" src="/images/GNS3-IOU.png" />
</div>
<div class="section" id="vpcs-integration-virtual-pc">
<h3>VPCs integration (Virtual PC):</h3>
<div class="highlight"><pre><span class="go">~ sudo aptitude install subversion</span>
<span class="go">~ cd /tmp</span>
<span class="go">~ svn checkout svn://svn.code.sf.net/p/vpcs/code/trunk vpcs-code</span>
<span class="go">or download it from : http://sourceforge.net/projects/vpcs/?source=typ_redirect</span>
<span class="go">~ cd vpcs-code/src</span>
<span class="go">~ sudo ./mk.sh</span>
<span class="go">~ sudo mv -f vpcs /usr/bin/vpcs</span>
</pre></div>
<p>And now you can put the correct path <cite>/usr/bin/vpcs</cite> for VPCS in your GNS3 preferences</p>
<img alt="" src="/images/GNS3-VPCS.png" />
</div>
<div class="section" id="gns3-converter">
<h3>GNS3 Converter</h3>
<p>GNS3 Converter allow you to convert your old gns3 files to get it works on the new GNS3 (<a class="reference external" href="http://forum.gns3.net/post35824.html">http://forum.gns3.net/post35824.html</a>) :</p>
<div class="highlight"><pre><span class="go">~ sudo pip3 install gns3-converter</span>
</pre></div>
</div>
<div class="section" id="roxterm">
<h3>Roxterm</h3>
<p>For a multi-tabbed terminal :</p>
<div class="highlight"><pre><span class="go">~ sudo aptitude install roxterm</span>
</pre></div>
<p>Then change your GNS3 settings : <cite>Edit->Preferences->General->Console applications-> Preconfigured commands</cite> and change from <cite>xterm</cite> to <cite>Roxterm</cite></p>
</div>
</div>
<div class="section" id="gns3-desktop-icon">
<h2>GNS3 desktop icon</h2>
<p>Just create a .desktop file :</p>
<div class="highlight"><pre><span class="go">~ sudo vi /usr/share/applications/gns3.desktop</span>
<span class="go">[Desktop Entry]</span>
<span class="go">Version=1.0</span>
<span class="go">Type=Application</span>
<span class="go">Terminal=false</span>
<span class="go">Exec=gns3 %f</span>
<span class="go">Name=GNS3</span>
<span class="go">Comment=GNS3 Graphical Network Simulator</span>
<span class="go">Icon=gns3</span>
<span class="go">Categories=Education;</span>
<span class="go">MimeType=application/x-gns3;</span>
<span class="go">Keywords=simulator;network;netsim;</span>
</pre></div>
</div>
Tip of the week 372014-08-24T22:40:00+02:00natjohantag:natjohan.info,2014-08-24:tip-of-the-week-37.html<img alt="" src="/images/Wireshark.png" />
<div class="section" id="running-wireshark-as-a-non-root">
<h2>Running Wireshark as a non root</h2>
<p>There is two different ways :</p>
<p>1/ On Debian based distributions :</p>
<div class="highlight"><pre><span class="go">~ sudo dpkg-reconfigure wireshark-common</span>
</pre></div>
<p>Then, just select yes and add your user to the wireshark group :</p>
<div class="highlight"><pre><span class="go">~ sudo adduser MYUSER wireshark</span>
</pre></div>
<p>2/ On other distros (you can do it on debian distibutions too) :</p>
<div class="highlight"><pre><span class="go">~ sudo chgrp adm /usr/bin/dumpcap</span>
<span class="go">~ sudo chmod 750 /usr/bin/dumpcap</span>
<span class="go">~ sudo setcap cap_net_raw,cap_net_admin+eip /usr/bin/dumpcap</span>
</pre></div>
<p>And you have to add your user in the adm group :</p>
<div class="highlight"><pre><span class="go">~ sudo adduser MYUSER adm</span>
</pre></div>
<div class="line-block">
<div class="line"><br /></div>
<div class="line"><br /></div>
<div class="line"><br /></div>
</div>
<!-- -->
<blockquote>
<strong>Note :</strong> Please be sure of what you're doing, this process may add some <strong>security risks</strong> to your system</blockquote>
</div>
Tip of the week 362014-08-10T14:42:00+02:00natjohantag:natjohan.info,2014-08-10:tip-of-the-week-36.html<img alt="" src="/images/VMware_logo.png" />
<div class="section" id="use-the-vmware-vsphere-web-under-elementaryos-ubuntu-with-chromium">
<h2>Use the VMware Vsphere web under elementaryos/ubuntu with chromium</h2>
<p>If you recently try to use the latest Vsphere web client under Linux, and you certainly saw
that this web client require at least the flash player version 11.5...</p>
<p>As Adobe stopped their Flash Player developpement under Linux :</p>
<!-- -->
<blockquote>
<strong>NOTE:</strong> Adobe Flash Player 11.2 will be the last version to target Linux as a supported platform. Adobe will continue to provide security backports to Flash Player 11.2 for Linux.</blockquote>
<p>Fortunatly Google provides an API called Pepper Flash Player and allow to use newer version of Flash Player,
to install it with your <a class="reference external" href="http://natjohan.info/tip-of-the-week-9.html">chromium</a> installation, you just have to add a ppa and install the following packet :</p>
<div class="highlight"><pre><span class="gp">$</span> sudo add-apt-repository ppa:skunk/pepper-flash
<span class="gp">$</span> sudo aptitude update
<span class="gp">$</span> sudo aptitude install pepflashplugin-installer
</pre></div>
<p>Then just edit <cite>/etc/chromium-browser/default</cite> :</p>
<div class="highlight"><pre><span class="gp">$</span> sudo vi /etc/chromium-browser/default
</pre></div>
<p>And add the following line at the end of the file</p>
<div class="highlight"><pre>. /usr/lib/pepflashplugin-installer/pepflashplayer.sh
</pre></div>
<p>And that's all, just restart chromium and visit <cite>chrome://plugins</cite> in order to check your Flash plugin version
(which should be higher than 11.5) and now you can use the Vmware Vsphere web client on your Linux install !
(<a class="reference external" href="https://vSphere_Web_Client_host_name_or_IP:9443">https://vSphere_Web_Client_host_name_or_IP:9443</a>)</p>
<img alt="" src="/images/chromium-pepper.png" />
</div>
Tip of the week 352014-06-11T20:38:00+02:00natjohantag:natjohan.info,2014-06-11:tip-of-the-week-35.html<img alt="" src="/images/graylog.png" />
<div class="section" id="simply-install-graylog-under-ubuntu-server">
<h2>Simply install Graylog under Ubuntu Server</h2>
<p><a class="reference external" href="http://graylog2.org/">Graylog</a> is an open source log management and data analytics. It's a 'Splunk' like but for free and open source, useful for collecting your syslog messages for example.</p>
<p>Here is a little script provided by <cite>mrlesmithjr</cite> on github to simply install Graylog on your server (and it works great) :</p>
<div class="highlight"><pre><span class="gp">$</span> sudo apt-get -y install git
<span class="gp">$</span> <span class="nb">cd</span> ~
<span class="gp">$</span> git clone https://github.com/mrlesmithjr/graylog2/
<span class="gp">$</span> chmod +x ./graylog2/install_graylog2_20_ubuntu.sh
<span class="gp">$</span> sudo ./graylog2/install_graylog2_20_ubuntu.sh
</pre></div>
<p>To read more about this script : <a class="reference external" href="https://github.com/mrlesmithjr/graylog2">https://github.com/mrlesmithjr/graylog2</a></p>
</div>
Tip of the week 342014-04-21T17:45:00+02:00natjohantag:natjohan.info,2014-04-21:tip-of-the-week-34.html<p>In a previous <cite>ToTW</cite>, I <a class="reference external" href="http://natjohan.info/tip-of-the-week-32.html">showed</a> you how to manage and install package under Sublime Text. Here is a useful markdown
plugin that I use to edit my markdown files : <a class="reference external" href="https://github.com/SublimeText-Markdown/MarkdownEditing">https://github.com/SublimeText-Markdown/MarkdownEditing</a> .</p>
<!-- -->
<blockquote>
<strong>Note</strong> : If you don't know the markdown format just goes <a class="reference external" href="http://en.wikipedia.org/wiki/Markdown">here</a> to learn more, in few words from
my point of view : markdown is a text format that allow you to focus only on your content rather than
how it looks (like the rst or lateX format)</blockquote>
<p>To install it under Sublim Text through <cite>Package Control</cite> just type <strong>ctrl+shift+p</strong> then <strong>Package Control : install package</strong>, enter key and type <strong>Markdown editing</strong>, enter key again, and that's all the package install should be done.</p>
<p>Now you can chose the <cite>MarkdownEditing</cite> synthax under your Sublime Text editor.</p>
<img alt="" src="/images/MarkdownEditing.png" />
JNC under ElementaryOs/Ubuntu2014-04-21T16:31:00+02:00natjohantag:natjohan.info,2014-04-21:jnc-under-elementaryosubuntu.html<p>Here is the way to simply install JNC (Juniper Network Connect which is the Juniper VPN client) under
ElementaryOs or Ubuntu</p>
<div class="section" id="installing-oracle-java-and-download-the-juniper-software">
<h2>1/ Installing Oracle Java and download the Juniper software</h2>
<p>If you're under a <strong>32 bits</strong> version (<cite>uname -a</cite> => i386)</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> sudo add-apt-repository ppa:webupd8team/java
<span class="gp">natjohan:~$</span> sudo apt-get update
<span class="gp">natjohan:~$</span> sudo apt-get install oracle-java7-set-default
</pre></div>
<p>Now, goes on your Juniper VPN server through your favorite web browser (<a class="reference external" href="https://vpn.mycompany.com">https://vpn.mycompany.com</a>),
just login and then click on the <cite>start</cite> button next to the <cite>Network Connect</cite> item</p>
<img alt="" src="/images/JNC_start.png" />
<p><strong>/!\</strong> Don't forget to accept execution of the Java applet in your web browser</p>
<p>Once you click on it a message will appear</p>
<img alt="" src="/images/JNC_wait.png" />
<p>Just wait few minutes, nothing happens but the JNC software should be downloaded under your home directory at
<cite>~/.juniper_networks/network_connect</cite>. If not, just go to <a class="reference external" href="https://vpn.mycompany.com/dana-cached/nc/ncLinuxApp.jar">https://vpn.mycompany.com/dana-cached/nc/ncLinuxApp.jar</a> in order to download the jar file</p>
<p>If you're under <strong>64 bits</strong> or if you don't want to install java at all (you're right !), just go
to <a class="reference external" href="https://vpn.mycompany.com">https://vpn.mycompany.com</a>, just login an go to <a class="reference external" href="https://vpn.mycompany.com/dana-cached/nc/ncLinuxApp.jar">https://vpn.mycompany.com/dana-cached/nc/ncLinuxApp.jar</a>
and download it on your computer.</p>
</div>
<div class="section" id="installing-jnc-wrapper">
<h2>2/ Installing JNC wrapper</h2>
<p>We will install JNC which is a perl wrapper for the Juniper network connect client provides by
Klara Mall.</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> sudo chown root:root ~/.juniper_networks/network_connect/ncsvc
<span class="gp">natjohan:~$</span> <span class="nb">cd</span> .juniper_networks
<span class="gp">natjohan:~$</span> unzip ~/.juniper_networks/ncLinuxApp.jar -d ~/.juniper_networks/network_connect/
<span class="gp">natjohan:~$</span> sudo chown root:root ~/.juniper_networks/network_connect/ncsvc
<span class="gp">natjohan:~$</span> sudo chmod 6711 ~/.juniper_networks/network_connect/ncsvc
<span class="gp">natjohan:~$</span> chmod 744 ~/.juniper_networks/network_connect/ncdiag
<span class="gp">natjohan:~$</span> <span class="nb">cd</span> /usr/local/bin
<span class="gp">natjohan:/usr/local/bin$</span> sudo wget http://www.scc.kit.edu/scc/net/juniper-vpn/linux/jnc
<span class="gp">natjohan:/usr/local/bin$</span> chmod a+x jnc
<span class="gp">natjohan:~$</span> sudo aptitude install openssl
</pre></div>
<p>Create the config directory</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> mkdir -p ~/.juniper_networks/network_connect/config
</pre></div>
<p>And now you can edit mycompanyvpn.conf under this directory with the following parameters</p>
<div class="highlight"><pre><span class="nv">host</span><span class="o">=</span>vpn.mycompany.com
<span class="nv">user</span><span class="o">=</span>username
<span class="nv">realm</span><span class="o">=</span>your_realm
<span class="nv">cafile</span><span class="o">=</span>/etc/ssl/mycompanycertificate.pem
</pre></div>
<p><strong>realm</strong> : if you don't know how to find your realm, just go to vpn.mycompany.com, take a look
at the html source of this page and try to find a line like this</p>
<div class="highlight"><pre><span class="nt"><input</span> <span class="na">type=</span><span class="s">"hidden"</span> <span class="na">name=</span><span class="s">"realm"</span> <span class="na">value=</span><span class="s">"REALMNAME"</span><span class="nt">></span>
</pre></div>
<p>If you don't find it, just try without this parameter or ask your IT department about that.</p>
<p><strong>cafile</strong> : just go to your vpn.mycompany.com page with you browser and click on the https logo,
then go to something like <cite>Show your certificate</cite>, then <cite>Details</cite>, and you probably can <cite>export</cite>
(it depends on your web browser) it in the .pem format. Just save it under <cite>/etc/ssl/mycompanycertificate.pem</cite>
(for example).</p>
<p>I know that you can put a <cite>password</cite> field in your config file, but you should not do that for
obvious security reasons</p>
</div>
<div class="section" id="launch-jnc">
<h2>3/ Launch JNC</h2>
<p>Now you can launch JNC wrapper and use your company's VPN</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> jnc --nox mycompanyvpn
<span class="go">Password:</span>
<span class="go">Connecting to XXXXX.com : 443.</span>
<span class="go">Waiting for ncsvc for 3 seconds... done</span>
<span class="go">ncsvc is running, but tunnel is not established yet. Waiting for 3 seconds... done.</span>
<span class="go">ncsvc is running in background (PID: 744):</span>
<span class="go">tunnel interface tun0, addr: X.X.X.X</span>
<span class="gp">natjohan:~$</span>
</pre></div>
<p>The <strong>--nox</strong> option is to launch jnc without gui. To stop it</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> jnc stop
<span class="go">ncsvc is running, sending signal... terminated.</span>
<span class="gp">natjohan:~$</span>
</pre></div>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">JNC wrapper <a class="reference external" href="http://www.scc.kit.edu/scc/net/juniper-vpn/linux/">webpage</a></div>
<div class="line">Troubleshoot <a class="reference external" href="http://holyarmy.org/2009/06/vpn-on-ubuntu-linux-with-juniper-network-connect/">tips</a></div>
<div class="line">JNC on <a class="reference external" href="https://wiki.archlinux.org/index.php/Juniper_VPN">archlinux</a>'s wiki</div>
<div class="line">Another method with the MadScientist script <a class="reference external" href="http://mad-scientist.us/juniper.html">msjnc</a></div>
<div class="line"><br /></div>
</div>
</div>
Tip of the week 332014-03-24T22:24:00+01:00natjohantag:natjohan.info,2014-03-24:tip-of-the-week-33.html<div class="section" id="connect-to-cisco-anyconnect-vpn-under-linux-with-openconnect">
<h2>Connect to Cisco Anyconnect VPN under Linux with <cite>OpenConnect</cite></h2>
<p>If you're on Linux and you want to connect to a Cisco VPN, Cisco provides
an Anyconnect client for Linux, unfortunately it's not well integrated with
your linux network manager.</p>
<p><cite>Openconnect</cite> is a great alternative to the Anyconnect client, it's available in
your distro repositories (just check <a class="reference external" href="http://www.infradead.org/openconnect/packages.html">here</a> to know the name of the package(s)) and it works
like a charm</p>
<p>In order to install it under ElementaryOs/Ubuntu (that's quite similar for other distro,
just chek the name of the package with the link above)</p>
<div class="highlight"><pre><span class="go">natjohan~$ sudo aptitude install openconnect network-manager-openconnect</span>
</pre></div>
<p>I used <cite>aptitude</cite> but it's the same with <cite>apt-get</cite>, now you're able to perform an anyconnect
connexion under your network manager</p>
<img alt="" src="/images/openconnect_integration.png" />
<div class="line-block">
<div class="line"><br /></div>
<div class="line"><br /></div>
</div>
<img alt="" src="/images/openconnect_vpn.png" />
<div class="line-block">
<div class="line"><br /></div>
<div class="line"><br /></div>
</div>
<img alt="" src="/images/openconnect_config.png" />
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">official <a class="reference external" href="http://www.infradead.org/openconnect/index.html">website</a></div>
<div class="line">Archlinux <a class="reference external" href="https://wiki.archlinux.org/index.php/OpenConnect">instructions</a></div>
<div class="line">If you have to use a software token : <a class="reference external" href="http://sourceforge.net/p/stoken/wiki/Home/">stocken</a></div>
<div class="line"><br /></div>
</div>
</div>
Tip of the week 322014-03-09T17:40:00+01:00natjohantag:natjohan.info,2014-03-09:tip-of-the-week-32.html<div class="section" id="add-and-manage-packages-under-sublime-text-with-package-control">
<h2>Add and manage packages under sublime text with <cite>Package Control</cite></h2>
<p><cite>Package Control</cite> allows you to install many addons for your Sublime Text editor.
To install it, simply goes <a class="reference external" href="https://sublime.wbond.net/installation">here</a> and follow the instructions.</p>
<p>Restart your editor and open the pallete with <cite>ctrl+shift+p</cite> (Win, Linux)
or <cite>cmd+shift+p</cite> (OS X) and type <cite>package</cite> to search and easily install packages.</p>
<p>You can browse and find package on <cite>Package Control</cite> <a class="reference external" href="https://sublime.wbond.net/browse">website</a></p>
</div>
Tip of the week 312014-01-28T18:01:00+01:00natjohantag:natjohan.info,2014-01-28:tip-of-the-week-31.html<img alt="" src="/images/Springseed_logo.png" />
<div class="section" id="springseed-simply-awesome-note-taking">
<h2>Springseed : <cite>Simply awesome note taking</cite></h2>
<p>I just want to present you a simple note taking app called Springseed. This application
allow you to take notes in <a class="reference external" href="http://en.wikipedia.org/wiki/Markdown">markdown</a> format and you can synchronize your notes with Dropbox.</p>
<p>To install it under ElementaryOs or Ubuntu, simply goes to <a class="reference external" href="http://getspringseed.com/">getspringseed.com</a> and download
the .deb</p>
<p>Enjoy this really clean and not disturbing app to focus on your decision notes ;-)</p>
<img alt="" src="/images/Springseed_example.png" />
</div>
Tip of the week 302014-01-20T21:28:00+01:00natjohantag:natjohan.info,2014-01-20:tip-of-the-week-30.html<img alt="" src="/images/Gnome-EncFS-tray.png" />
<div class="section" id="gnome-encfs-manager">
<h2>Gnome EncFS Manager</h2>
<p>As I switched on <a class="reference external" href="http://elementaryos.org/">ElementaryOs</a> (which is a really great distrib) few months ago, I just discovered a new tool to mount my <a class="reference external" href="http://natjohan.info/encfs-simply-protect-and-access-to-your-private-data-on-cloud-services.html">EncFS</a> folders. Actually CryptKeeper didn't work properly under Elementary (due to some <a class="reference external" href="https://bugs.launchpad.net/elementaryos/+bug/1196312">bugs</a> with the tray system). So, I found a tool called Gnome EncFS Manager, and it works great.
Here is the way to install it under Elementary (or Ubuntu)</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> sudo add-apt-repository ppa:gencfsm <span class="o">&&</span> sudo apt-get update <span class="o">&&</span> sudo apt-get install gnome-encfs-manager
</pre></div>
<p>Then you can easily manage(mount/umount/create) your encrypted folders</p>
<img alt="" src="/images/Gnome-EncFS-configure.png" />
<div class="line-block">
<div class="line"><br /></div>
</div>
<!-- -->
<blockquote>
<strong>Note :</strong> you can install this tool under many other distro (Fedora, Debian, OpenSuse and Arch)</blockquote>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<p>The project <a class="reference external" href="http://libertyzero.com/GEncfsM/">webpage</a> (All screenshots credits to this webpage)</p>
</div>
Tip of the week 292014-01-14T19:56:00+01:00natjohantag:natjohan.info,2014-01-14:tip-of-the-week-29.html<div class="section" id="a-little-cisco-ios-embedded-event-manager-eem-script-example">
<h2>A little Cisco IOS Embedded Event Manager (EEM) script example</h2>
<p>Here is a little script to retrieve and store the output of command periodically on your cisco router.
It can be usefull when logs don't want to speak.</p>
<div class="highlight"><pre><span class="go">conf t</span>
<span class="go">!</span>
<span class="go">event manager session cli username <myusername></span>
<span class="go">event manager applet MyScriptLogs</span>
<span class="go">event timer watchdog name MyScriptLogs time <mytimer></span>
<span class="go">action 1 cli command “en"</span>
<span class="go">action 2 cli command “show clock | append bootflash:MyScriptLogs"</span>
<span class="go">action 3 cli command "show policy-map interface | append bootflash:MyScriptLogs"</span>
<span class="go">!</span>
<span class="go">End</span>
</pre></div>
<p>Where <cite><myusername></cite> is an user who has privileges to execute the following commands and <mytimer> is the time in seconds between each instance of the script.</p>
<!-- -->
<blockquote>
<strong>Note</strong> : you can add many commands to this script with 'action X cli command'.</blockquote>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<p>EEM on Cisco <a class="reference external" href="http://www.cisco.com/en/US/products/ps6815/products_ios_protocol_group_home.html">website</a></p>
</div>
Tip of the week 282014-01-06T22:03:00+01:00natjohantag:natjohan.info,2014-01-06:tip-of-the-week-28.html<div class="section" id="install-python3-2-pip-and-virtualenv">
<h2>Install python3.2, pip and virtualenv</h2>
<p>As Elementary is based on Ubuntu 12.04, here is the way to install python3 and pip on it :</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> sudo aptitude install python3
<span class="gp">natjohan:~$</span> wget http://python-distribute.org/distribute_setup.py
<span class="gp">natjohan:~$</span> sudo python3 distribute_setup.py
<span class="gp">natjohan:~$</span> sudo easy_install-3.2 pip
</pre></div>
<p>And now you can use <cite>pip-3.2</cite> to install your python3 package :</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> pip-3.2 install virtualenv
</pre></div>
<p>Let's code now !</p>
</div>
<div class="section" id="go-futher">
<h2>Go Futher</h2>
<div class="line-block">
<div class="line"><br /></div>
<div class="line"><a class="reference external" href="http://python-distribute.org/">http://python-distribute.org/</a></div>
<div class="line"><a class="reference external" href="http://docs.python.org/3.2/howto/index.html">http://docs.python.org/3.2/howto/index.html</a></div>
<div class="line">VirtualEnv <a class="reference external" href="http://www.virtualenv.org/en/latest/">documentation</a></div>
<div class="line"><br /></div>
</div>
<p>Note that in python 3.3, <cite>venv</cite> will be available (<a class="reference external" href="http://docs.python.org/3/library/venv.html">http://docs.python.org/3/library/venv.html</a>)</p>
</div>
Tip of the week 272014-01-02T22:38:00+01:00natjohantag:natjohan.info,2014-01-02:tip-of-the-week-27.html<img alt="" src="/images/sublimeCisco.png" />
<div class="section" id="highlight-your-cisco-ios-configurations-under-sublime-text">
<h2>Highlight your Cisco IOS configurations under Sublime Text</h2>
<p>Here is a little tip if you're using Sublime Text (which is a really great text editor with many useful features)
It's quite easy, you just have to download the IOS language definitions and put it under your Sublime Text package directory (~/.config/sublime-text-2/Packages/ on Linux)</p>
<div class="highlight"><pre><span class="gp">natjohan:~$</span> <span class="nb">cd</span> ~/.config/sublime-text-2/Packages/
<span class="gp">natjohan:~$</span> mkdir Cisco <span class="o">&&</span> <span class="nb">cd </span>Cisco
<span class="gp">natjohan:~$</span> wget https://raw.github.com/illotum/IOS-Syntax/master/Cisco%20IOS.tmLanguage
<span class="gp">natjohan:~$</span> wget https://raw.github.com/illotum/IOS-Syntax/master/Cisco%20IOS.JSON-tmLanguage
</pre></div>
<p>And now all your .ios files have a syntax highlight in your Sublime Text editor, otherwise you can choose your Cisco syntax in your syntax list</p>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<ul class="simple">
<li>Download Sublime Text <a class="reference external" href="http://www.sublimetext.com/">here</a></li>
<li>The git repo for the IOS Syntax on <a class="reference external" href="https://github.com/illotum/IOS-Syntax">github</a></li>
</ul>
</div>
Tip of the week 262013-10-23T22:21:00+02:00natjohantag:natjohan.info,2013-10-23:tip-of-the-week-26.html<div class="section" id="erase-your-command-line-history">
<h2>Erase your command line history</h2>
<p>Here is a little tip to erase your command line history on a linux machine,
simply use the <cite>history</cite> command, that's a built'in shell command which
allows you to show your command history in your terminal. Having an history of
your command is quite useful in many situations, but sometimes, when you use some
confidential data (eg. passwords) in your command, you should delete the whole
or a particular entry of this history</p>
<div class="highlight"><pre><span class="go"> natjohan# history</span>
<span class="go">4 ping 8.8.8.8</span>
<span class="go">5 openssl passwd -1 mypassword</span>
<span class="go">6 echo ioldelaiiiou</span>
<span class="go">7 history</span>
<span class="go"> natjohan# history -d 5</span>
<span class="go"> natjohan# history</span>
<span class="go"> 4 ping 8.8.8.8</span>
<span class="go">5 echo ioldelaiiiou</span>
<span class="go">6 history</span>
<span class="go">7 history -d 5</span>
<span class="go">8 history</span>
<span class="go">natjohan# history -c</span>
<span class="go">natjohan# history</span>
<span class="go">4 history</span>
</pre></div>
<p>So <cite>history</cite> shows you your history, <cite>history -d line_number</cite> delete a particular
entry and <cite>history -c</cite> delete the whole list</p>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<p>RTFM : man history</p>
</div>
Tip of the week 252013-10-09T20:37:00+02:00natjohantag:natjohan.info,2013-10-09:tip-of-the-week-25.html<img alt="" src="/images/glances_logo.png" />
<div class="section" id="glances-an-eye-on-your-system">
<h2><em>Glances an eye on your system</em></h2>
<p>Are you tired to use top/free/fdisk, and other tools to show your system health ? So Glances
is for you. It provides many system informations (process, CPU, network, etc) in your terminal</p>
<p>The easiest way to install it is to use pip (python package manager), you can install pip with your
favorite package manager then install glances</p>
<div class="highlight"><pre><span class="go">natjohan# yum install python-pip</span>
<span class="go">natjohan# pip install glances</span>
</pre></div>
<p>To launch it :</p>
<div class="highlight"><pre><span class="go">natjohan# glances</span>
</pre></div>
<img alt="" src="/images/glances_screen.png" />
<p>It's just a must have tool on your hosts !</p>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<div class="line-block">
<div class="line">Official <a class="reference external" href="https://github.com/nicolargo/glances">repo</a> on github</div>
<div class="line">the creator <a class="reference external" href="http://blog.nicolargo.com/">blog</a> (in french)</div>
</div>
<p>All credits for Nicolargo and the official documentation of Glances</p>
</div>
Tip of the week 242013-09-24T13:19:00+02:00natjohantag:natjohan.info,2013-09-24:tip-of-the-week-24.html<img alt="" src="/images/pdf_folder.png" />
<div class="section" id="easily-assemble-merge-extract-your-pdf-files-under-linux-with-pdftk">
<h2>Easily assemble, merge, extract your pdf files under linux with <cite>pdftk</cite></h2>
<p><cite>pdftk</cite>, is a useful command line utility that allow to manipulate your pdf files. You can install it
through your favorite package manager (example under Fedora)</p>
<div class="highlight"><pre><span class="go">natjohan# yum install pdftk</span>
</pre></div>
<p>The syntax of pdftk is very simple :</p>
<div class="highlight"><pre>pdftk <span class="nt"><input_files_seperate_by_spaces></span> <span class="nt"><operation></span> output <span class="nt"><output_file></span>
</pre></div>
<p>Ok, so let's try it with two commons examples using cat operation :</p>
<p><strong>Merge</strong> some pdf files</p>
<div class="highlight"><pre><span class="go">natjohan# pdftk A.pdf B.pdf C.pdf cat output ABC.pdf</span>
</pre></div>
<p><strong>Extract</strong> a page from a pdf file</p>
<div class="highlight"><pre><span class="go">natjohan# pdftk my_doc.pdf cat 4-6 output page4to6.pdf</span>
</pre></div>
<p>Note that pdftk is a very powerful tool and it allow many operations (extract from the documentation)</p>
<blockquote>
<div class="line-block">
<div class="line"><em>Merge PDF Documents or Collate PDF Page Scans</em></div>
<div class="line"><em>Split PDF Pages into a New Document</em></div>
<div class="line"><em>Rotate PDF Documents or Pages</em></div>
<div class="line"><em>Decrypt Input as Necessary (Password Required)</em></div>
<div class="line"><em>Encrypt Output as Desired</em></div>
<div class="line"><em>Fill PDF Forms with X/FDF Data and/or Flatten Forms</em></div>
<div class="line"><em>Generate FDF Data Stencils from PDF Forms</em></div>
<div class="line"><em>Apply a Background Watermark or a Foreground Stamp</em></div>
<div class="line"><em>Report PDF Metrics such as Metadata and Bookmarks</em></div>
<div class="line"><em>Update PDF Metadata</em></div>
<div class="line"><em>Attach Files to PDF Pages or the PDF Document</em></div>
<div class="line"><em>Unpack PDF Attachments</em></div>
<div class="line"><em>Burst a PDF Document into Single Pages</em></div>
<div class="line"><em>Uncompress and Re-Compress Page Streams</em></div>
<div class="line"><em>Repair Corrupted PDF (Where Possible)</em></div>
</div>
</blockquote>
</div>
<div class="section" id="pdftk-gui">
<h2>Pdftk GUI</h2>
<p>You're afraid of using the command line ? no problem, there is a GUI called pdfchain, just install it with your package manager</p>
<div class="highlight"><pre><span class="go">natjohan# yum install pdfchain</span>
</pre></div>
<img alt="" src="/images/pdfchain.png" />
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<div class="line-block">
<div class="line">man pdftk</div>
<div class="line">CLI examples on the official <a class="reference external" href="http://www.pdflabs.com/docs/pdftk-cli-examples/">website</a> of pdftk</div>
<div class="line">Pdfchain offical <a class="reference external" href="http://pdfchain.sourceforge.net/">webpage</a></div>
</div>
</div>
Tip of the week 232013-08-04T12:19:00+02:00natjohantag:natjohan.info,2013-08-04:tip-of-the-week-23.html<div class="section" id="search-and-replace-a-character-string-in-multiple-files-with-sed">
<h2>Search and replace a character string in multiple files with sed</h2>
<p><em>`Sed`, Stream Editor is a Unix utility that parses and transforms text.</em></p>
<p>Here is a simple and useful example : replace the character string <strong>'priority 300'</strong> by
<strong>'bandwidth priority percent 10'</strong> in all .txt files in our current directory</p>
<div class="highlight"><pre>find . -type f -iname <span class="s1">'*.txt'</span> -exec sed -i <span class="s1">'s/priority 300/bandwidth priority percent 10/'</span> <span class="o">{}</span> +
</pre></div>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<div class="line-block">
<div class="line">The Sed <a class="reference external" href="http://sed.sourceforge.net/sedfaq2.html#s2.1">FAQ</a></div>
<div class="line"><a class="reference external" href="http://www.grymoire.com/Unix/Sed.html">Sed An Introduction and Tutorial by Bruce Barnett</a></div>
<div class="line"><a class="reference external" href="http://en.wikipedia.org/wiki/Sed">Sed</a> on wikipedia</div>
</div>
</div>
Tip of the week 222013-07-15T14:39:00+02:00natjohantag:natjohan.info,2013-07-15:tip-of-the-week-22.html<img alt="" src="/images/battery.png" />
<div class="section" id="power-management-and-optimizations-with-powertop">
<h2>Power management and optimizations with powertop</h2>
<p>Powertop is a little utilitie that allow you to reduce your computer power consumption. This is an interesting soft for laptop owner, to install it, simply use you favorite package manager</p>
<div class="highlight"><pre><span class="go">natjohan# yum install powertop</span>
</pre></div>
<p>Now, just launch <cite>powertop</cite> command with root privileges, the most interesting part is located in <cite>tunable</cite> tab. With this tab you can activate/deactivate many power tweaks simply by press Enter</p>
<img alt="" src="/images/powertop_tunable.png" />
<p>you can also generate an html report with <cite>powertop --html</cite></p>
<img alt="" src="/images/powertop_report.png" />
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<p>The official <a class="reference external" href="https://01.org/powertop/">website</a>
Source code on <a class="reference external" href="https://github.com/fenrus75/powertop">github</a></p>
</div>
Tip of the week 212013-07-14T21:20:00+02:00natjohantag:natjohan.info,2013-07-14:tip-of-the-week-21.html<div class="section" id="easily-tweak-your-fedora-installation-with-fedora-utils">
<h2>Easily tweak your Fedora installation with Fedora Utils</h2>
<dl class="docutils">
<dt>Fedora Utils brings you many tweaks for your Fedora install like :</dt>
<dd><ul class="first last simple">
<li>codecs</li>
<li>additional softwares (chrome, flash, steam, skype, etc)</li>
<li>optimizations (ssd, clean cache, etc)</li>
<li>simply manage your repos</li>
<li>update your grub config</li>
<li>and more</li>
</ul>
</dd>
</dl>
<div class="section" id="installation">
<h3>Installation</h3>
<p>According to the <a class="reference external" href="http://satya164.github.io/fedorautils/">official page</a>, just launch this command in your terminal</p>
<div class="highlight"><pre><span class="go">natjohan# su -c "curl http://download.opensuse.org/repositories/home:/satya164:/fedorautils/Fedora_19/home:satya164:fedorautils.repo -o /etc/yum.repos.d/fedorautils.repo && yum install fedorautils"</span>
</pre></div>
<p>Then, just call <cite>fedorautils</cite> command and begin your tweaks !</p>
<img alt="" src="/images/fu-tweaks.png" />
<p>image credits : satya164</p>
</div>
</div>
Tip of the week 202013-06-16T23:27:00+02:00natjohantag:natjohan.info,2013-06-16:tip-of-the-week-20.html<div class="section" id="problem-with-x11-forwarding-on-debian-squeeze">
<h2>Problem with X11 forwarding on Debian Squeeze</h2>
<p>Few weeks ago I experienced problems with my X11 forwarding on Debian Squeeze, after googling and tried to solve my problem, I found an issue <a class="reference external" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422327">here</a>. Actually, disabling ipv6 makes X11 over ssh crashes. So if you want to make X11 forwarding works, you just have to add the following line in your <cite>/etc/ssh/sshd_config</cite></p>
<div class="highlight"><pre>AddressFamily inet
</pre></div>
<p>Hope it helps ;-)</p>
</div>
Tip of the week 192013-06-09T23:07:00+02:00natjohantag:natjohan.info,2013-06-09:tip-of-the-week-19.html<img alt="" src="/images/monitor_file.png" />
<div class="section" id="monitor-file-changes-to-trigger-an-action">
<h2>Monitor file changes to trigger an action</h2>
<div class="section" id="incron">
<h3>Incron</h3>
<p>According to the man incron is <em>an "inotify cron" system. It consists of a daemon and a table manipulator. You can use it a similar way as the regular cron. The difference is that the inotify cron handles filesystem events rather than time periods.</em></p>
</div>
<div class="section" id="installation">
<h3>Installation</h3>
<p>Just install the following package with your favorite package installer (yum for Fedora, aptitude for Debian/ubuntu, pacman or yaourt for archlinux)</p>
<div class="highlight"><pre><span class="go">natjohan# yum install incron</span>
<span class="go">natjohan# rpm -ql incron</span>
<span class="go"> /etc/incron.conf</span>
<span class="go"> /etc/incron.d</span>
<span class="go"> /usr/bin/incrontab</span>
<span class="go"> /usr/lib/systemd/system/incrond.service</span>
<span class="go"> /usr/sbin/incrond</span>
<span class="go"> /usr/share/doc/incron-0.5.10</span>
<span class="go"> /usr/share/doc/incron-0.5.10/CHANGELOG</span>
<span class="go"> /usr/share/doc/incron-0.5.10/COPYING</span>
<span class="go"> /usr/share/doc/incron-0.5.10/LICENSE-GPL</span>
<span class="go"> /usr/share/doc/incron-0.5.10/README</span>
<span class="go"> /usr/share/doc/incron-0.5.10/TODO</span>
<span class="go"> /usr/share/man/man1/incrontab.1.gz</span>
<span class="go"> /usr/share/man/man5/incron.conf.5.gz</span>
<span class="go"> /usr/share/man/man5/incrontab.5.gz</span>
<span class="go"> /usr/share/man/man8/incrond.8.gz</span>
<span class="go"> /var/spool/incron</span>
</pre></div>
</div>
<div class="section" id="usage">
<h3>Usage</h3>
<dl class="docutils">
<dt>Main files are :</dt>
<dd><ul class="first last simple">
<li>/etc/incron.conf : main incron configuration file</li>
<li>/etc/incron.allow : contains users allowed to use incron, you have to create it</li>
</ul>
</dd>
</dl>
<p>At first you have to create <cite>/etc/incron.allow</cite> , for example (to allow root to use incron)</p>
<div class="highlight"><pre><span class="go">root</span>
</pre></div>
<p>The incron syntax is</p>
<div class="highlight"><pre><span class="nt"><file</span> <span class="err">|</span> <span class="err">directory</span><span class="nt">></span> <span class="nt"><event></span> <span class="nt"><command></span> <span class="nt"><options></span>
</pre></div>
<p>Events are the following</p>
<div class="highlight"><pre><span class="go">IN_ACCESS File was accessed (read) (*)</span>
<span class="go">IN_ATTRIB Metadata changed (permissions, timestamps, extended attributes, etc.) (*)</span>
<span class="go">IN_CLOSE_WRITE File opened for writing was closed (*)</span>
<span class="go">IN_CLOSE_NOWRITE File not opened for writing was closed (*)</span>
<span class="go">IN_CREATE File/directory created in watched directory (*)</span>
<span class="go">IN_DELETE File/directory deleted from watched directory (*)</span>
<span class="go">IN_DELETE_SELF Watched file/directory was itself deleted</span>
<span class="go">IN_MODIFY File was modified (*)</span>
<span class="go">IN_MOVE_SELF Watched file/directory was itself moved</span>
<span class="go">IN_MOVED_FROM File moved out of watched directory (*)</span>
<span class="go">IN_MOVED_TO File moved into watched directory (*)</span>
<span class="go">IN_OPEN File was opened (*)</span>
</pre></div>
<p>There is som wildcard you can use in your command</p>
<div class="highlight"><pre><span class="gp">$</span><span class="nv">$ </span>dollar sign
<span class="gp">$</span>@ watched filesystem path <span class="o">(</span>see above<span class="o">)</span>
<span class="gp">$</span><span class="c"># event-related file name</span>
<span class="gp">$</span>% event flags <span class="o">(</span>textually<span class="o">)</span>
<span class="gp">$</span>& event flags <span class="o">(</span>numerically<span class="o">)</span>
</pre></div>
<p>Now you can chose a file to trigger (here, we just want to restart the freeradius service when the user file changes), and add an entry in your incron with</p>
<div class="highlight"><pre><span class="go">natjohan# incrontab -e</span>
<span class="go">/etc/freeradius/users IN_CLOSE_WRITE, NO_LOOP /etc/init.d/freeradius restart</span>
<span class="go">natjohan# incrontab -l</span>
<span class="go">/etc/freeradius/users IN_CLOSE_WRITE, NO_LOOP /etc/init.d/freeradius restart</span>
</pre></div>
<div class="line-block">
<div class="line"><br /></div>
<div class="line"><br /></div>
</div>
<!-- -->
<blockquote>
<strong>Note :</strong> On Fedora 18, if you don't have vim installed, the <cite>incrontab -e</cite> output an error message <cite>editor finished with error: No such file or directory</cite> which mean you just have to edit <cite>/etc/incron.conf</cite> with <cite>editor = vi</cite> in or install vim</blockquote>
</div>
<div class="section" id="troubleshooting">
<h3>Troubleshooting</h3>
<p>Just open another terminal and you can show incron commands with</p>
<div class="highlight"><pre><span class="go">natjohan# tail -f /var/log/syslog</span>
<span class="go">or</span>
<span class="go">natjohan# tail -f /var/log/cron</span>
<span class="go">(it depends on your system)</span>
<span class="go">Jun 09 23:21:46 srv incrond[17290]: (root) CMD (/etc/init.d/freeradius restart)</span>
</pre></div>
</div>
<div class="section" id="tip">
<h3>Tip</h3>
<p>Incron does not allow to monitor a file several times (one line per file/folder only), so if you want to launch many commands, the cleanest way to do it is to create a bash file with your commands.</p>
<div class="highlight"><pre><span class="go">natjohan# incrontab -e</span>
<span class="go">/etc/freeradius/users IN_CLOSE_WRITE, NO_LOOP myscript</span>
</pre></div>
</div>
<div class="section" id="go-further">
<h3>Go further</h3>
<div class="line-block">
<div class="line">official <a class="reference external" href="http://inotify.aiken.cz/">website</a></div>
<div class="line"><a class="reference external" href="http://linux.die.net/man/5/incrontab">RTFM</a></div>
</div>
</div>
</div>
Tip of the week 182013-05-13T20:07:00+02:00natjohantag:natjohan.info,2013-05-13:tip-of-the-week-18.html<img alt="" src="/images/clock.png" />
<div class="section" id="setting-up-your-own-ntp-server-without-internet-connexion">
<h2>Setting up your own ntp server without internet connexion</h2>
<p><a class="reference external" href="http://fr.wikipedia.org/wiki/Network_Time_Protocol">NTP</a> (Network Time Protocol) is a protocol that allows to synchronize your computers clocks on your network.</p>
<div class="section" id="installation">
<h3>Installation</h3>
<p>With your favorite package manager</p>
<div class="highlight"><pre><span class="go">natjohan(fedora)# yum install ntp</span>
<span class="go">natjohan(debian)# aptitude install ntp</span>
</pre></div>
</div>
<div class="section" id="configuration">
<h3>Configuration</h3>
<p>NTPD is quite easy to understand, all you need is to edit <cite>/etc/ntp.conf</cite>, and launch the service :</p>
<div class="highlight"><pre><span class="go">natjohan# service ntpd restart</span>
</pre></div>
<p>Ok, that's weird, but if you want to set up your own NTP server <strong>without an internet connexion</strong> (I mean, you do not have internet access and you want to synchronize your devices with the local time of your server), you just have to edit your <cite>ntp.conf</cite> file, comment the server part and modify like that</p>
<div class="highlight"><pre><span class="c">#server my.pool.ntp.org</span>
server 127.127.1.0
fudge 127.127.1.0 stratum 10
</pre></div>
<p><a class="reference external" href="http://linuxwave.blogspot.fr/2007/08/setting-up-your-own-ntp-server.html">source</a></p>
</div>
</div>
Tip of the week 172013-04-15T22:47:00+02:00natjohantag:natjohan.info,2013-04-15:tip-of-the-week-17.html<div class="section" id="serve-your-apache-website-only-on-localhost">
<h2>Serve your apache website only on localhost</h2>
<p>When you want to test something with apache2, it's useful to serve it only on localhost to see what happens and make sure everything goes well. So, you just have to edit your <cite>/etc/apache2/ports.conf</cite> and set the Listen directive to :</p>
<div class="highlight"><pre><span class="go">Listen 127.0.0.1:80</span>
<span class="go">Listen 127.0.0.1:443 (if you want https)</span>
</pre></div>
<p>Then, just restart apache2 :</p>
<div class="highlight"><pre><span class="go">natjohan# service apache2 restart</span>
<span class="go">or</span>
<span class="go">natjohan# /etc/init.d/apache2 restart</span>
</pre></div>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<p><a class="reference external" href="http://httpd.apache.org/docs/2.2/en/bind.html">the official apache documentation about binding</a></p>
</div>
Tip of the week 162013-04-14T14:11:00+02:00natjohantag:natjohan.info,2013-04-14:tip-of-the-week-16.html<img alt="" src="/images/splunk-logo.png" />
<div class="section" id="secure-your-splunk-free-server">
<h2>Secure your Splunk Free server</h2>
<p>"Splunk Enterprise is a fully featured, powerful platform for collecting, searching, monitoring and analyzing machine data". There is a free version of Splunk with some limitations (read <a class="reference external" href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Admin/MoreAboutSplunkFree">here</a>), but it's sufficent to analyze fews hosts logs (< 20). The major disadvatage of this edition is the lack of an authentication module for the web interface, which mean anyone can access to your splunk interface and show your data.</p>
<p>One way to secure it is to bind SplunkWeb on localhost and use a ssh tunnel to access it.</p>
<div class="section" id="configuration">
<h3>Configuration</h3>
<p>You just have to edit <cite>$SPLUNK_HOME/etc/system/default/web.conf</cite> to uncomment and modify this line like that :</p>
<div class="highlight"><pre><span class="go">server.socket_host = localhost</span>
</pre></div>
<p>Restart Splunk :</p>
<div class="highlight"><pre><span class="go">splunk-server# $SPLUNK_HOME/bin/splunk restart splunk</span>
</pre></div>
<p>Verify your configuration :</p>
<div class="highlight"><pre><span class="go">splunk-server# netstat -an | grep 8000</span>
<span class="go"> tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN</span>
</pre></div>
</div>
<div class="section" id="access">
<h3>Access</h3>
<p>Now, if you want to access your SplunkWeb interface, you need to setup a ssh tunnel between your pc and your server to forward the remote 8000 port on your pc</p>
<div class="highlight"><pre><span class="go">natjohan# ssh -L 8000:127.0.0.1:8000 myremoteuser@<splunk-server-address></span>
</pre></div>
<p>Explanation : the <cite>-L 8000</cite> option mean you specify the local port on your pc to access to <cite>127.0.0.1:8000</cite> on your remote server</p>
<p>Now your can access to your Splunk interface on your pc by typing <a class="reference external" href="https://127.0.0.1:8000">https://127.0.0.1:8000</a> in your browser.</p>
</div>
<div class="section" id="go-further">
<h3>Go Further</h3>
<div class="line-block">
<div class="line"><a class="reference external" href="http://wiki.splunk.com/Community:DeployHardenedSplunk">Splunk wiki Deploy hardened Splunk</a></div>
<div class="line"><a class="reference external" href="http://blog.7elements.co.uk/2012/11/quick-post-securing-splunk-free.html">source</a></div>
</div>
</div>
</div>
Tip of the week 152013-04-06T16:04:00+02:00natjohantag:natjohan.info,2013-04-06:tip-of-the-week-15.html<img alt="" src="/images/mstsc.png" />
<div class="section" id="access-to-linux-desktop-from-windows-with-mstsc">
<h2>Access to Linux desktop from Windows with mstsc</h2>
<p>If you're working on Linux servers from Microsoft environment, you probably want to simply access to your servers desktop with <a class="reference external" href="http://en.wikipedia.org/wiki/Remote_Desktop_Protocol">RDP</a> protocol thanks to mstsc. XRDP daemon is an open source RDP server, it uses vnc4server as backend.</p>
</div>
<div class="section" id="installation">
<h2>Installation</h2>
<div class="section" id="on-debian-based-distributions">
<h3>On Debian based distributions</h3>
<p>(Tested on Debian Squeeze) XRDP is in Debian main packages :</p>
<div class="highlight"><pre><span class="go">Natjohan# yum install xrdp</span>
</pre></div>
<p>That's it, XRDP works out of the box ! Now you can launch your mstsc client.</p>
<img alt="" src="/images/xrdp.png" />
</div>
<div class="section" id="on-fedora">
<h3>On Fedora</h3>
<p>(tested on Fedora 18)</p>
<div class="highlight"><pre><span class="go">Natjohan# yum install xrdp</span>
<span class="go">Natjohan# systemctl enable xrdp.service</span>
<span class="go"> ln -s '/usr/lib/systemd/system/xrdp.service' '/etc/systemd/system/multi-user.target.wants/xrdp.service'</span>
<span class="go">Natjohan# systemctl start xrdp.service</span>
</pre></div>
<p>That's it !</p>
<!-- -->
<blockquote>
<strong>Note :</strong> Don't forget to update your firewall rules to allow connexions on TCP port 3389</blockquote>
<div class="line-block">
<div class="line"><br /></div>
</div>
<img alt="" src="/images/firewall.png" />
</div>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<div class="line-block">
<div class="line"><a class="reference external" href="http://www.xrdp.org/">xrdp official website</a></div>
<div class="line"><a class="reference external" href="https://github.com/FreeRDP/xrdp">xrdp project on github</a></div>
<div class="line"><a class="reference external" href="https://fedoraproject.org/wiki/FirewallD">Fedora FirewallD</a></div>
<div class="line"><br /></div>
</div>
</div>
Tip of the week 142013-03-28T22:22:00+01:00natjohantag:natjohan.info,2013-03-28:tip-of-the-week-14.html<img alt="" src="/images/terminator.png" />
<div class="section" id="terminator-a-powerful-terminal-for-sysadmins">
<h2>Terminator : a powerful terminal for sysadmins</h2>
<p>You dream of having a terminal that allow to open many terms in one window, launch a same update/fix on these terms with a replicate system, with a lot of keyboard shortcuts, multiple layouts/profiles, and more ?
<cite>Terminator</cite> is for you !</p>
<div class="section" id="installation">
<h3>Installation</h3>
<p><cite>Terminator</cite> is available in many distros (Debian, Fedora, Ubuntu, RHEL, FreeBSD, etc) , and you can install it with your favorite package installer :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install terminator</span>
<span class="go">or</span>
<span class="go">natjohan# aptitude install terminator</span>
</pre></div>
<p>That's it ! Enjoy ;-)</p>
<p>official <a class="reference external" href="http://www.tenshu.net/p/terminator.html">website</a></p>
</div>
</div>
Tip of the week 132013-03-19T21:13:00+01:00natjohantag:natjohan.info,2013-03-19:tip-of-the-week-13.html<div class="section" id="display-a-pre-and-after-login-message-in-your-terminal">
<h2>Display a pre and after login message in your terminal</h2>
<div class="section" id="pre-login-message">
<h3>pre login message</h3>
<p>With the file <cite>/etc/issue</cite>, you can personnalize the displayed message at your tty connection, just edit this file as root, exit your tty and reopen, tadaaaa :</p>
<div class="highlight"><pre><span class="gp">#</span><span class="c">###############################################################################</span>
<span class="gp">#</span> Warning ! This is a restricted area, access is reserved <span class="k">for </span>authorized users <span class="c">#</span>
<span class="gp">#</span> Unauthorized access may involve prosecution <span class="c">#</span>
<span class="gp">#</span> Disconnect IMMEDIATELY <span class="k">if </span>you are not an authorized user! <span class="c">#</span>
<span class="gp">#</span><span class="c">###############################################################################</span>
<span class="go">user :</span>
</pre></div>
<div class="line-block">
<div class="line"><br /></div>
<div class="line"><br /></div>
<div class="line"><br /></div>
</div>
<!-- -->
<blockquote>
<strong>Note :</strong> Obviously, for security reasons, you shouldn't put sensitive informations in this file (like OS version, password, etc), because you can show it even if you are not logged in</blockquote>
<p>You can can put escape sequence in your banner, you should find the different sequences with a <cite>man agetty</cite> (agetty usually analyze this file in many distros)</p>
<div class="highlight"><pre><span class="go"> The issue-file (/etc/issue or the file set with the -f option) may contain certain escape codes to display the system name, date and time etc. All escape codes consist of a backslash (\) immediately followed by one of the letters explained below.</span>
<span class="go">b Insert the baudrate of the current line.</span>
<span class="go">d Insert the current date.</span>
<span class="go">s Insert the system name, the name of the operating system. Same as `uname -s'.</span>
<span class="go">l Insert the name of the current tty line.</span>
<span class="go">m Insert the architecture identifier of the machine. Same as `uname -m'.</span>
<span class="go">n Insert the nodename of the machine, also known as the hostname. Same as `uname -n'.</span>
<span class="go">o Insert the NIS domainname of the machine. Same as `hostname -d'.</span>
<span class="go">O Insert the DNS domainname of the machine.</span>
<span class="go">r Insert the release number of the OS. Same as `uname -r'.</span>
<span class="go">t Insert the current time.</span>
<span class="go">u Insert the number of current users logged in.</span>
<span class="go">U Insert the string "1 user" or "<n> users" where <n> is the number of current users logged in.</span>
<span class="go">v Insert the version of the OS, eg. the build-date etc.</span>
<span class="go">Example: On my system, the following /etc/issue file:</span>
<span class="go"> This is \n.\o (\s \m \r) \t</span>
<span class="go">displays as</span>
<span class="go"> This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30</span>
</pre></div>
</div>
<div class="section" id="pre-login-message-and-open-ssh-server">
<h3>pre login message and open ssh server</h3>
<p>If you want to display a banner for your ssh server, you just have to edit the sshd configuration file located in /etc/ssh/sshd_config and add or uncomment the following line (you can choose another file of your choice like <cite>/etc/myissueforsshd</cite>)</p>
<div class="highlight"><pre><span class="go">banner /etc/issue</span>
</pre></div>
<p>Then restart your open ssh server :</p>
<div class="highlight"><pre><span class="go">natjohan# service sshd restart</span>
</pre></div>
</div>
<div class="section" id="after-login-message">
<h3>after login message</h3>
<p>You can put a message for logged users with <cite>/etc/motd</cite> file also called the "Mot Of The Day".</p>
<!-- -->
<blockquote>
<strong>Note :</strong> Debian has a particular way to deal with motd, you just have to edit <cite>/etc/motd.tail</cite> if you want to keep you modifications, because <cite>/etc/motd</cite> is updated at each reboot (<a class="reference external" href="http://wiki.debian.org/motd">debian wiki</a>)</blockquote>
<p>Here is an example with the linux_logo command (just install it with a <cite>yum install linux_logo</cite> in Fedora) :</p>
<div class="highlight"><pre><span class="go">natjohan# linux_logo -F "Fedora Linux 5.2\nKernel Version #V\n#U\n" > /etc/motd</span>
</pre></div>
<p>Here is the result :</p>
<div class="highlight"><pre><span class="go"> #####</span>
<span class="go"> #######</span>
<span class="go"> @ ##O#O##</span>
<span class="gp">#</span><span class="c">##### @@# #VVVVV#</span>
<span class="gp">#</span><span class="c"># # ## VVV ##</span>
<span class="gp">#</span><span class="c"># @@@ ### #### ### ### ##### ###### # ##</span>
<span class="gp">#</span><span class="c"># @ @# ### ## ## ## ### ## # ##</span>
<span class="gp">#</span><span class="c"># @ @# ## ## ## ## ### # ###</span>
<span class="gp">#</span><span class="c"># @@# ## ## ## ## ### QQ# ##Q</span>
<span class="gp">#</span><span class="c"># # @@# ## ## ## ## ## ## QQQQQQ# #QQQQQQ</span>
<span class="gp">#</span><span class="c"># ## @@# # ## ## ### ### ## ## QQQQQQQ# #QQQQQQQ</span>
<span class="gp">#</span><span class="c">########### ### #### #### #### ### ##### ###### QQQQQ#######QQQQQ</span>
<span class="go"> Fedora Linux 5.2</span>
<span class="go"> Kernel Version 3.8.1-201.fc18.x86_64</span>
<span class="go"> Uptime 2 hours 48 minutes</span>
</pre></div>
<p>If you want to know more about linux_logo command just RTFM !</p>
</div>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<ul class="simple">
<li>Pimp your motd with <a class="reference external" href="https://github.com/iptoux/dyMotd">dynmotd</a> : a dynamic motd with colors !</li>
<li>A fancy motd <a class="reference external" href="http://www.raspberrypi.org/phpBB3/viewtopic.php?t=23440">example</a></li>
</ul>
</div>
Tip of the week 122013-03-10T21:38:00+01:00natjohantag:natjohan.info,2013-03-10:tip-of-the-week-12.html<div class="section" id="detect-ip-address-conflicts-with-the-arping-command">
<h2>Detect IP address conflicts with the arping command</h2>
<p>If you're working in large network environment and you have some ip conflicts, you can use <cite>arping</cite> command under Linux. This command sends arp requests on the Ethernet layer and is a part of iputils package (so <cite>arping</cite> is available on many distros)</p>
<div class="section" id="usage">
<h3>Usage</h3>
<p><cite>arping</cite> usage is very easy :</p>
<div class="highlight"><pre><span class="go">natjohan$ arping</span>
<span class="go"> Usage: arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination</span>
<span class="go"> -f : quit on first reply</span>
<span class="go"> -q : be quiet</span>
<span class="go"> -b : keep broadcasting, don't go unicast</span>
<span class="go"> -D : duplicate address detection mode</span>
<span class="go"> -U : Unsolicited ARP mode, update your neighbours</span>
<span class="go"> -A : ARP answer mode, update your neighbours</span>
<span class="go"> -V : print version and exit</span>
<span class="go"> -c count : how many packets to send</span>
<span class="go"> -w timeout : how long to wait for a reply</span>
<span class="go"> -I device : which ethernet device to use</span>
<span class="go"> -s source : source ip address</span>
<span class="go"> destination : ask for what ip address</span>
<span class="go">natjohan$ arping -I wlan0 192.168.1.15</span>
<span class="go"> ARPING 192.168.1.15 from 192.168.1.17 wlan0</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 166.580ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [00:16:44:12:91:86] 167.651ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 171.751ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 89.035ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 112.753ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 32.680ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 56.519ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 81.120ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 104.755ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 34.628ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 51.382ms</span>
<span class="go"> Unicast reply from 192.168.1.15 [5C:0A:5B:26:72:82] 75.083ms</span>
<span class="go"> ^CSent 11 probes (1 broadcast(s))</span>
<span class="go"> Received 12 response(s)</span>
</pre></div>
<p>The main options are : <strong>-I</strong> to define on which interface you want to send arp requests and the IP address you want to test, in the example above you can see that two MAC have the 192.168.1.15 ip address ([5C:0A:5B:26:72:82] and [00:16:44:12:91:86])</p>
</div>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<p>For your scripts : use the -D option to know if an IP is already used, <em>Duplicate address detection mode (DAD). See RFC2131, 4.4.1. Returns 0, if DAD succeeded i.e. no replies are received</em></p>
</div>
Tip of the week 112013-03-04T22:52:00+01:00natjohantag:natjohan.info,2013-03-04:tip-of-the-week-11.html<div class="section" id="question-mark-in-your-cisco-conf">
<h2>Question mark in your Cisco conf</h2>
<p>In Cisco CLI, the question mark allow you to obtain a list of command/options.</p>
<div class="highlight"><pre><span class="go">Router(config)# enable secret ?</span>
<span class="go"> 0 Specifies an UNENCRYPTED password will follow</span>
<span class="go"> 5 Specifies an ENCRYPTED secret will follow</span>
<span class="go"> LINE The UNENCRYPTED (cleartext) 'enable' secret</span>
<span class="go"> level Set exec level password</span>
</pre></div>
<p>But : how to put a question mark in your Cisco description, or in your Cisco password ?</p>
<div class="highlight"><pre><span class="go">Router(config)# enable secret QuestionMark_(type CTRL + V here)_?</span>
</pre></div>
<p>In your descriptions :</p>
<div class="highlight"><pre><span class="go">Router(config)# int Ge0/1/0</span>
<span class="go">Router(config-if)# description in use _(type CTRL + V here)_?</span>
</pre></div>
<p>Actually, if you want to use question mark in your Cisco conf as a normal character, you just have to type <cite>Ctrl + V</cite> before!</p>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<p>Read this <a class="reference external" href="http://www.cisco.com/en/US/docs/ios/12_2/termserv/configuration/guide/tcfaapre_ps1835_TSD_Products_Configuration_Guide_Chapter.html">article</a> about RegEx in Cisco IOS</p>
</div>
Tip of the week 102013-02-25T23:35:00+01:00natjohantag:natjohan.info,2013-02-25:tip-of-the-week-10.html<div class="section" id="qalculate-the-ultimate-desktop-calculator">
<h2>Qalculate - the ultimate desktop calculator !</h2>
<p>According to the official <a class="reference external" href="http://qalculate.sourceforge.net/index.html">website</a>, Qalculate is :
<cite>a multi-purpose desktop calculator for GNU/Linux. It is small and simple to use but with much power and versatility underneath. Features include customizable functions, units, arbitrary precision, plotting, and a user-friendly interface (KDE or GTK+).</cite></p>
<p>Qalculate is also coming with a command line tool called qalc</p>
</div>
<div class="section" id="installation">
<h2>Installation</h2>
<p><cite>Qalculate</cite> is available on our favorite distro defaults repos (debian, ubuntu, fedora...), so you just have to use your package installer, on Fedora :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install qalculate</span>
</pre></div>
<p>Note : There is a GUI version : qalculate-gtk or qalculate-kde</p>
<div class="highlight"><pre><span class="go">natjohan# yum install qalculate-gtk</span>
</pre></div>
<p>You should read the official <a class="reference external" href="http://qalculate.sourceforge.net/gtk-manual/">documentation</a> for this GUI</p>
<img alt="" src="/images/qalculate.png" />
<p>For your first use of qalc command :</p>
<div class="highlight"><pre><span class="go">natjohan$ qalc</span>
<span class="go"> You need the download exchange rates to be able to convert between different currencies.</span>
<span class="go"> You can later get current exchange rates with the "exchange rates" command.</span>
<span class="go"> Do you want to fetch exchange rates now from the Internet (default yes)?</span>
<span class="go"> Please answer yes or no: yes</span>
<span class="go"> > exit</span>
</pre></div>
</div>
<div class="section" id="usage">
<h2>Usage</h2>
<p>Here is few examples of qalc command, unfortunately there isn't man page but the synthax is easy to understand and use.</p>
<div class="section" id="currency-converter">
<h3>Currency converter</h3>
<p>So now your able to convert currencies from your command line, example :</p>
<div class="highlight"><pre><span class="go">natjohan$ qalc 1EUR = xCAD</span>
<span class="go"> (1 * euro) = (x * CAD) = x = 1.3458</span>
<span class="go">natjohan$ qalc 1EUR = xCHF</span>
<span class="go"> (1 * euro) = (x * CHF) = x = 1.2272</span>
<span class="go">natjohan$ qalc 12EUR + 155USD = x GBP</span>
<span class="go"> ((12 * euro) + (155 * dollar)) = (x * GBP) = - x = 111.67764</span>
</pre></div>
<p>Many currencies are available, just type the <a class="reference external" href="http://www.xe.com/iso4217.php">iso 4217 code</a></p>
<!-- note : this is an approximation, you should verify your results on the web -->
</div>
<div class="section" id="unit-converter">
<h3>Unit converter</h3>
<p>Works with many units :</p>
<div class="highlight"><pre><span class="go">natjohan$ qalc 11km/52min = x km/h</span>
<span class="go"> ((11 * kilometer) / (52 * minute)) = ((x * kilometer) / hour) = - x = 12.692308</span>
<span class="go">natjohan$ qalc 1800cal = x J</span>
<span class="go"> (1800 * calorie) = (x * joule) = x = 7536.24</span>
<span class="go">natjohan$ qalc 40miles = x km</span>
<span class="go"> (40 * mile) = (x * kilometer) = x = 64.37376</span>
<span class="go">natjohan$ qalc 40nautical_miles = x km</span>
<span class="go"> (40 * nautical_mile) = (x * kilometer) = x = 74.08</span>
<span class="go">natjohan$ qalc 65l / 877km = x l/100km</span>
<span class="go"> ((65 * liter) / (877 * kilometer)) = ((x * liter) / (100 * kilometer)) = - x = 7.4116306</span>
<span class="go">natjohan$ qalc 1 years = x second</span>
<span class="go"> (1 * year) = (x * second) = x = 31557600</span>
</pre></div>
<p>To calculate Unix timestamp :</p>
<div class="highlight"><pre><span class="go">natjohan$ qalc timestamp 2013-02-25</span>
<span class="go"> timestamp("2013-02-25") = 1.3617468E9</span>
</pre></div>
<p>To solve problems like : "How many days will it take to transfer 200GiB at 1.25MiB/sec" :</p>
<div class="highlight"><pre><span class="go">natjohan$ qalc "200Gibyte / 1.25(Mibyte/second) = x day"</span>
<span class="go"> ((200 * gibibyte) / (1.25 * (mebibyte / second))) = (x * day) = - x = 1.8962963</span>
</pre></div>
</div>
<div class="section" id="functions-variables">
<h3>Functions & variables</h3>
<p>Qalculate comes with many functions : Economic, Statistics, geometry, etc and variables like physical constants. That a great point for scientists :P</p>
</div>
<div class="section" id="interactive-mode">
<h3>Interactive mode</h3>
<p>Note you can use previous example in interactive mode, simply launch <cite>qalc</cite> command</p>
<div class="highlight"><pre><span class="go">natjohan$ qalc</span>
<span class="go"> ></span>
</pre></div>
</div>
<div class="section" id="tips">
<h3>Tips</h3>
<p>To find function or unit name you can launch the GUI and made an insert, or if you don't have the GUI : just go in <cite>/usr/share/qalculate</cite> and cat the xml files.</p>
</div>
</div>
Tip of the week 92013-02-18T19:39:00+01:00natjohantag:natjohan.info,2013-02-18:tip-of-the-week-9.html<img alt="" src="/images/chromium-logo.png" />
<div class="section" id="chromium">
<h2>Chromium</h2>
<p><cite>Chromium</cite> is an open source browser from which Google Chrome is based. Actually Chromium seems to be very similar to Chrome but there is some important differences, in few words, Chromium = Chrome (with few <a class="reference external" href="http://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome">changes</a>) + open source (under BSD licence) + privacy (RLZ tracking is disabled in chromium, see <a class="reference external" href="http://en.wikipedia.org/wiki/Chromium_(web_browser)">wikipedia</a>).</p>
</div>
<div class="section" id="install-chromium-on-fedora">
<h2>Install Chromium on Fedora</h2>
<p>Chromium is not on the default repo, so you just have to add this repo maintained by Tom Callaway from Red-Hat with :</p>
<div class="highlight"><pre><span class="go">natjohan# su -lc 'cd /etc/yum.repos.d && wget http://repos.fedorapeople.org/repos/spot/chromium/fedora-chromium-stable.repo'</span>
</pre></div>
<p>OR just create a file called <cite>fedora-chromium.repo</cite> under <cite>/etc/yum.repo/</cite> with this content :</p>
<div class="highlight"><pre><span class="go">[fedora-chromium-stable]</span>
<span class="go">name=Builds of the "stable" tag of the Chromium Web Browser</span>
<span class="gp">baseurl=http://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-$releasever/$</span>basearch/
<span class="go">enabled=1</span>
<span class="go">skip_if_unavailable=1</span>
<span class="go">gpgcheck=0</span>
<span class="go">[fedora-chromium-stable-source]</span>
<span class="go">name=Builds of the "stable" tag of the Chromium Web Browser - Source</span>
<span class="gp">baseurl=http://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-$</span>releasever/SRPMS
<span class="go">enabled=0</span>
<span class="go">skip_if_unavailable=1</span>
<span class="go">gpgcheck=0</span>
</pre></div>
<p>Then, install it with yum command :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install chromium</span>
</pre></div>
<p>Note : this is not the latest version of chromium (v23 - december 2012), however there is no major changes in v26, but hope Tom Callaway maintained this repo up to date</p>
</div>
<div class="section" id="go-further">
<h2>Go further</h2>
<p>Official <a class="reference external" href="http://www.chromium.org/Home">website</a>
If you really want to take care of your privacy and use Chromium, i recommand you to use DuckDuckGo (just change your search settings) and read this <a class="reference external" href="http://www.howtogeek.com/100361/how-to-optimize-google-chrome-for-maximum-privacy/">article</a></p>
</div>
Tip of the week 82013-02-18T19:38:00+01:00natjohantag:natjohan.info,2013-02-18:tip-of-the-week-8.html<div class="section" id="linux-commands-to-retrieve-your-system-distro-version">
<h2>Linux commands to retrieve your system & distro version</h2>
<p>There many ways to know your system and your distro version, here are few ways to find it :</p>
<div class="section" id="show-your-linux-version">
<h3>Show your Linux Version :</h3>
<p>To show linux version using <cite>/proc/</cite></p>
<div class="highlight"><pre><span class="go">natjohan$ cat /proc/version</span>
<span class="go"> Linux version 3.7.4-204.fc18.x86_64 (mockbuild@bkernel01.phx2.fedoraproject.org) (gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC) ) #1 SMP Wed Jan 23 16:44:29 UTC 2013</span>
</pre></div>
<p>With <cite>dmsg</cite> command :</p>
<div class="highlight"><pre><span class="go">natjohan$ dmesg | grep "Linux version"</span>
<span class="go"> [ 0.000000] Linux version 3.7.4-204.fc18.x86_64 (mockbuild@bkernel01.phx2.fedoraproject.org) (gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC) ) #1 SMP Wed Jan 23 16:44:29 UTC 2013</span>
</pre></div>
<p>With <cite>uname</cite> :</p>
<div class="highlight"><pre><span class="go">natjohan$ uname -a</span>
<span class="go"> Linux cerize-laptop 3.7.4-204.fc18.x86_64 #1 SMP Wed Jan 23 16:44:29 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux</span>
</pre></div>
</div>
<div class="section" id="to-check-your-distro-version">
<h3>To check your distro version</h3>
<p>With <cite>/etc/</cite> :</p>
<div class="highlight"><pre><span class="go">natjohan$ cat /etc/issue</span>
<span class="go"> Fedora release 18 (Spherical Cow)</span>
<span class="go"> Kernel \r on an \m (\l)</span>
</pre></div>
<p>Or :</p>
<div class="highlight"><pre><span class="go">natjohan$ cat /etc/*release*</span>
<span class="go"> Fedora release 18 (Spherical Cow)</span>
<span class="go"> cat: /etc/lsb-release.d: est un dossier</span>
<span class="go"> NAME=Fedora</span>
<span class="go"> VERSION="18 (Spherical Cow)"</span>
<span class="go"> ID=fedora</span>
<span class="go"> VERSION_ID=18</span>
<span class="go"> PRETTY_NAME="Fedora 18 (Spherical Cow)"</span>
<span class="go"> ANSI_COLOR="0;34"</span>
<span class="go"> CPE_NAME="cpe:/o:fedoraproject:fedora:18"</span>
<span class="go"> Fedora release 18 (Spherical Cow)</span>
<span class="go"> Fedora release 18 (Spherical Cow)</span>
<span class="go"> cpe:/o:fedoraproject:fedora:18</span>
</pre></div>
<p>With <cite>lsb_release</cite> (if it's installed):</p>
<div class="highlight"><pre><span class="go">natjohan$ lsb_release -a</span>
<span class="go"> LSB Version: :core-4.1-amd64:core-4.1-ia32:core-4.1-noarch:cxx-4.1-ia32:cxx-4.1-noarch:desktop-4.1-ia32:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-ia32:printing-4.1-noarch</span>
<span class="go"> Distributor ID: Fedora</span>
<span class="go"> Description: Fedora release 18 (Spherical Cow)</span>
<span class="go"> Release: 18</span>
<span class="go"> Codename: SphericalCow</span>
</pre></div>
</div>
</div>
Canon Edit : how to solve libtiff.so.3 problem2013-02-11T20:17:00+01:00natjohantag:natjohan.info,2013-02-11:canon-edit-how-to-solve-libtiffso3-problem.html<p>Edit : 11/02/2013</p>
<img alt="" src="/images/Canon-mg3250.png" />
<p>I just upgraded my system from Fedora 17 to Fedora 18, and my canon printer doesn't work anymore. I followed the debug <a class="reference external" href="http://fedoraproject.org/wiki/How_to_debug_printing_problems">guide</a> and it's due to libtiff library (Fedora 17 use libtiff.so.3 and Fedora 18 use libtiff.so.4). Here is a way to make things work again.</p>
<p>Download libtiff.so.3 from here : <a class="reference external" href="http://rpm.pbone.net/">http://rpm.pbone.net/</a> (check advanced search -> fedora 17)
extact the content of the rpm with :</p>
<div class="highlight"><pre><span class="go">natjohan# rpm2cpio my-packet-libtiff.rmp | cpio -idmv</span>
</pre></div>
<p>Copy files in your lib64 :</p>
<div class="highlight"><pre><span class="go">natjohan# cp -r ./usr/* /usr</span>
</pre></div>
<p>create and unlink some symlinks like this :</p>
<div class="highlight"><pre><span class="go">natjohan# ls -l libtiff*</span>
<span class="go">lrwxrwxrwx. 1 root root 12 30 janv. 13:33 libtiff.so -> libtiff.so.3</span>
<span class="go">lrwxrwxrwx. 1 root root 16 30 janv. 13:35 libtiff.so.3 -> libtiff.so.5.2.0</span>
<span class="go">-rwxr-xr-x. 1 root root 409600 30 janv. 12:26 libtiff.so.3.9.7</span>
<span class="go">lrwxrwxrwx. 1 root root 16 30 janv. 11:41 libtiff.so.5 -> libtiff.so.5.2.0</span>
<span class="go">-rwxr-xr-x. 1 root root 409600 30 janv. 12:26 libtiff.so.5.2.0</span>
<span class="go">lrwxrwxrwx. 1 root root 14 30 janv. 13:35 libtiffxx.so -> libtiffxx.so.3</span>
<span class="go">lrwxrwxrwx. 1 root root 18 30 janv. 13:46 libtiffxx.so.3 -> libtiffxx.so.3.9.7</span>
<span class="go">-rwxr-xr-x. 1 root root 10280 30 janv. 12:26 libtiffxx.so.3.9.7</span>
<span class="go">lrwxrwxrwx. 1 root root 18 30 janv. 11:41 libtiffxx.so.5 -> libtiffxx.so.5.2.0</span>
<span class="go">-rwxr-xr-x. 1 root root 11416 13 déc. 20:27 libtiffxx.so.5.2.0</span>
</pre></div>
<p>First you have to unlink symlink from libtiff.so.5 (ie: <cite>unlink libtifxx.so</cite>, etc), then :</p>
<div class="highlight"><pre><span class="go">natjohan# ln -s libtiff.so.3 libtiff.so</span>
<span class="go">natjohan# ln -s libtiffxx.so.3 libtiffxx.so</span>
<span class="go">natjohan# ln -sf libtiffxx.so.3.9.7 libtiffxx.so.3</span>
</pre></div>
<p>Now the <cite>ldconfig</cite> command result should be empty, if not you're doing something wrong</p>
<p>If your printer isn't installed yet : download the canon printer officials <a class="reference external" href="http://www.canon-europe.com/Support/Consumer_Products/products/Fax__Multifunctionals/InkJet/PIXMA_MG_series/PIXMA_MG3240.aspx?type=download&page=1">drivers</a> (rpm) and go in package directory :</p>
<div class="highlight"><pre><span class="go">natjohan# rpm -Uvh ./packages/cnijfilter-common-3.80-1.x86_64.rpm</span>
<span class="go"> Préparation... ################################# [100%]</span>
<span class="go"> Updating / installing...</span>
<span class="go"> 1:cnijfilter-common-3.80-1 ################################# [100%]</span>
<span class="go">natjohan# rpm -Uvh ./packages/cnijfilter-mg3200series-3.80-1.x86_64.rpm --nodeps</span>
<span class="go"> Préparation... ################################# [100%]</span>
<span class="go"> Updating / installing...</span>
<span class="go"> 1:cnijfilter-mg3200series-3.80-1 ################################# [100%]</span>
</pre></div>
<p>Now you can add/use your canon MG3250, enjoy !</p>
Install GNS3 on Fedora 182013-02-04T20:24:00+01:00natjohantag:natjohan.info,2013-02-04:install-gns3-on-fedora-18.html<img alt="" src="/images/GNS3-logo.png" />
<p>GNS3 is a famous network simulator which allow to test network topologies and equipements.</p>
<div class="section" id="installation">
<h2>Installation</h2>
<p>First you have to install <cite>Telnet</cite> and <cite>PyQt4</cite> library with :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install telnet pyqt4</span>
</pre></div>
<p>Then, install GNS3, download the tgz archive from the official <a class="reference external" href="http://www.gns3.net/download/">website</a> :</p>
<div class="highlight"><pre><span class="go">natjohan# tar -xvzf GNS3-0.8.3.1-src.tar.gz</span>
<span class="go">natjohan# cd GNS3-0.8.3.1-src/</span>
<span class="go">natjohan# python2.7 setup.py build</span>
<span class="go">natjohan# python2.7 setup.py install</span>
</pre></div>
<p>To emulate Cisco devices, you need dynamips. You can install dynamips from <a class="reference external" href="http://www.gns3.net/dynamips/">source</a> or from RPM-Sphere repository, so, at first, add RPM-Sphere repo provided by Huaren Zhong. Create <cite>/etc/yum.repos.d/rpm-sphere.repo</cite> file and add</p>
<div class="highlight"><pre><span class="go">[rpm-sphere]</span>
<span class="go">name=RPM Sphere</span>
<span class="go">baseurl=http://download.opensuse.org/repositories/home:/zhonghuaren/Fedora_18/</span>
<span class="go">gpgkey=http://download.opensuse.org/repositories/home:/zhonghuaren/Fedora_18/repodata/repomd.xml.key</span>
<span class="go">enabled=1</span>
<span class="go">gpgcheck=1</span>
</pre></div>
<p>Then install dynamips package :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install dynamips</span>
</pre></div>
</div>
<div class="section" id="usage">
<h2>Usage</h2>
<p>Now you can launch GNS3 from a user prompt and follow the start instructions !</p>
<div class="highlight"><pre><span class="go">natjohan$ gns3</span>
</pre></div>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<p>GNS <a class="reference external" href="http://www.gns3.net/documentation/">documentation</a></p>
</div>
Tip of the week 72013-02-04T19:36:00+01:00natjohantag:natjohan.info,2013-02-04:tip-of-the-week-7.html<div class="section" id="upgrading-fedora-with-fedup">
<h2>Upgrading Fedora with FedUp</h2>
<p>FedUp (Fedora Upgrading) is the new tool to upgrade Fedora. It replaces Preupgrade used in previous releases.</p>
<p>I tested it on Fedora 17 to 18, and it works well, here is the process :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install fedup</span>
<span class="go">natjohan# fedup-cli --network 18 --debuglog fedupdebug.log</span>
</pre></div>
<p>That's all, if there isn't errors, you just have to reboot your system !</p>
<!-- Note : you should read more about FedUp on `Fedora wiki <http://fedoraproject.org/wiki/FedUp#How_Can_I_Upgrade_My_System_with_FedUp.3F>`_ before use it -->
</div>
Easily recover your data from corrupted usb disk/memory card2013-01-28T13:42:00+01:00natjohantag:natjohan.info,2013-01-28:easily-recover-your-data-from-corrupted-usb-diskmemory-card.html<p>Yesterday, I just wanted to move my pictures from my memory card to my computer. Unfortunatly, my memory card doesn't mount automatically under linux (Fedora), so i tried to mount it manually</p>
<div class="highlight"><pre><span class="go">natjohan# fdisk -l</span>
<span class="go">[...]</span>
<span class="go">Périphérique Amorce Début Fin Blocs Id Système</span>
<span class="go">/dev/sdc1 8192 15564799 7778304 b W95 FAT32</span>
<span class="go">natjohan# mount -t vfat /dev/sdc1 /mnt/</span>
<span class="go">mount: mauvais type de système de fichiers, option erronée, superbloc</span>
<span class="go"> erroné sur /dev/sdc1, page de code ou aide manquante, ou autre erreur</span>
<span class="go"> Dans quelques cas certaines informations sont utiles dans le journal</span>
<span class="go"> système — essayez « dmesg | tail » ou quelque chose du genre</span>
</pre></div>
<p>Oooops, it doesn't works, what's in <cite>dmesg</cite> ?</p>
<div class="highlight"><pre><span class="go">natjohan# dmesg | tail</span>
<span class="go">[ 2571.223469] usb 2-1: new low-speed USB device number 2 using xhci_hcd</span>
<span class="go">[ 2571.269795] usb 2-1: New USB device found, idVendor=046d, idProduct=c01e</span>
<span class="go">[ 2571.269805] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0</span>
<span class="go">[ 2571.269810] usb 2-1: Product: USB-PS/2 Optical Mouse</span>
<span class="go">[ 2571.269815] usb 2-1: Manufacturer: Logitech</span>
<span class="go">[ 2571.271718] usb 2-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes</span>
<span class="go">[ 2571.289396] input: Logitech USB-PS/2 Optical Mouse as /devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb2/2-1/2-1:1.0/input/input11</span>
<span class="go">[ 2571.290150] hid-generic 0003:046D:C01E.0001: input,hidraw0: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:03:00.0-1/input0</span>
<span class="go">[ 2677.921938] FAT-fs (sdc1): invalid media value (0x00)</span>
<span class="go">[ 2677.921944] FAT-fs (sdc1): Can't find a valid FAT filesystem</span>
</pre></div>
<p>I was really annoyed (all my pictures from christmas :( , but with a quicksearch I found a very interesting tool called <a class="reference external" href="http://www.cgsecurity.org/wiki/PhotoRec">photorec</a> :</p>
<!-- -->
<blockquote>
<em>PhotoRec is file data recovery software designed to</em> <strong>recover lost files</strong> <em>including video, documents and archives from hard disks, CD-ROMs, and lost pictures (thus the Photo Recovery name) from digital camera memory. PhotoRec ignores the file system and goes after the underlying data, so it will still work</em> <strong>even if your media's file system has been severely damaged or reformatted.</strong></blockquote>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">Moreover, <cite>Photorec</cite> is :</div>
<div class="line">- free and open source (GPLV v2+)</div>
<div class="line">- developped by a french developper : Christian Grenier (thank you to him)</div>
<div class="line">- multi-platform (Linux, Win and OSX)</div>
<div class="line">- support most of filesystems : FAT, NTFS, Ext2/3/4, ExFAT, HFS+</div>
</div>
<p>What a promise ! So let's test it, under Fedora, there is a packet called <cite>testdisk</cite> (<a class="reference external" href="http://www.cgsecurity.org/wiki/TestDisk">testdisk</a> is a suite which include photorec, note testdisk looks great too for recovering lost partition or boot sectors, hope I never need to use it)</p>
<div class="highlight"><pre><span class="go">natjohan# yum install testdisk</span>
</pre></div>
<p>Then, you just have to call <cite>photorec</cite> and follow the instructions</p>
<div class="highlight"><pre><span class="go">natjohan# photorec</span>
</pre></div>
<p>Choose your storage device, your partition, folder for recovered files, etc. And take some time to drink a cup of coffee :)</p>
<img alt="photorec in progress" src="/images/photorec.png" />
<p>That's it ! Then you can format your device (in FAT 32 for example) with :</p>
<div class="highlight"><pre><span class="go">natjohan# mkfs.vfat -cvF 32 /dev/sdc1</span>
</pre></div>
<p><strong>WARNING :</strong> Be really careful before formating a disk, <strong>you will not be able to recover your data</strong>, check that you are applying the command to the right device before you hit ENTER</p>
<blockquote>
Note: I supposed you have a partition created on the disk, before you format it.</blockquote>
Tip of the week 62013-01-28T13:40:00+01:00natjohantag:natjohan.info,2013-01-28:tip-of-the-week-6.html<img alt="" src="/images/lldpd-why.png" />
<div class="section" id="know-your-network-neighbors-thanks-to-lldpd-daemon">
<h2>Know your network neighbors thanks to lldpd daemon</h2>
<p>This week, i would like to present you lldpd. Actually, it's a useful daemon for GNU/Linux, BSD, Mac OS X developped by <a class="reference external" href="http://vincent.bernat.im">Vincent Bernat</a>. The picture above summarizes the situation very well ;-).</p>
<p>Actually, this tool <em>is a 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments.</em>. Thanks to this tool, you can discover your network neighbors (if they use LLDP/CDP/EDP/SONMP/FDP protocols) and advertise capabilities/identities of your network interfaces.</p>
</div>
<div class="section" id="installation-usage">
<h2>Installation & usage</h2>
<p>lldpd is well documented, so you I can only advise you to read this documentation and follow the <a class="reference external" href="http://vincentbernat.github.com/lldpd/installation.html">instructions</a> to install it on your system.</p>
<p>Then you can use <cite>lldpctl</cite> or <cite>lldpcli</cite> (this one provide an interactive shell) to watch your network neighboors (<strong>pssst, there is a -f option for format, you can choose xml or json, it's very interesting for your script/backend UI</strong>) and configure your interfaces. The <cite>lldpd</cite> command allow you to debug/manage lldpd daemon.</p>
<p><a class="reference external" href="http://vincentbernat.github.com/lldpd/usage.html">RTFM</a> now !</p>
<p>Example of output for <cite>lldpcli</cite> -> <cite>show neighbor detail</cite> (from the official doc):</p>
<div class="highlight"><pre><span class="gp">#</span> show neighbors detail
<span class="go">-------------------------------------------------------------------------------</span>
<span class="go">Interface: eth0, via: LLDP, RID: 1, Time: 0 day, 00:00:10</span>
<span class="go"> Chassis:</span>
<span class="go"> ChassisID: mac 00:18:f3:03:4e:06</span>
<span class="go"> SysName: dev-01.example.com</span>
<span class="go"> SysDescr: Debian GNU/Linux 7.0 (wheezy) Linux 3.7-trunk-amd64 #1 SMP Debian 3.7.1-1~experimental.1 x86_64</span>
<span class="go"> MgmtIP: 192.168.20.127</span>
<span class="go"> Capability: Bridge, on</span>
<span class="go"> Capability: Router, on</span>
<span class="go"> Capability: Wlan, off</span>
<span class="go"> Port:</span>
<span class="go"> PortID: mac ea:b8:ab:aa:8c:da</span>
<span class="go"> PortDescr: eth1</span>
<span class="go"> PMD autoneg: supported: no, enabled: no</span>
<span class="go"> MAU oper type: 10GigBaseR - R PCS/PMA, unknown PMD.</span>
<span class="go"> LLDP-MED:</span>
<span class="go"> Device Type: Media Endpoint (Class II)</span>
<span class="go"> Capability: Capabilities</span>
<span class="go"> Capability: Policy</span>
<span class="go"> Capability: Location</span>
<span class="go"> Capability: MDI/PSE</span>
<span class="go"> Capability: MDI/PD</span>
<span class="go"> Capability: Inventory</span>
<span class="go"> Inventory:</span>
<span class="go"> Hardware Revision: System Version</span>
<span class="go"> Software Revision: 3.7-trunk-amd64</span>
<span class="go"> Firmware Revision: 2104</span>
<span class="go"> Serial Number: System Serial Number</span>
<span class="go"> Manufacturer: System manufacturer</span>
<span class="go"> Model: System Product Name</span>
<span class="go"> Asset ID: Asset-1234567890</span>
<span class="go">-------------------------------------------------------------------------------</span>
</pre></div>
<p>So i think this tool is very useful to simplify your data-center configuration</p>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<p><a class="reference external" href="http://en.wikipedia.org/wiki/Link_Layer_Discovery_Protocol">LLDP</a> on wikipedia</p>
</div>
Tip of the week 52013-01-22T14:26:00+01:00natjohantag:natjohan.info,2013-01-22:tip-of-the-week-5.html<img alt="" src="/images/Any.do-global.png" />
<div class="section" id="any-do">
<h2>Any.Do</h2>
<p>A fancy, useful, cool app to manage your tasks and improve your productivity ;-). It's a very simple app coming with :</p>
<div class="line-block">
<div class="line">- <a class="reference external" href="https://play.google.com/store/apps/details?id=com.anydo">Android app</a> (with widgets, status bar notifications,)</div>
<div class="line">- <a class="reference external" href="http://itunes.apple.com/us/app/any.do/id497328576">Iphone app</a></div>
<div class="line">- <a class="reference external" href="https://chrome.google.com/webstore/detail/kdadialhpiikehpdeejjeiikopddkjem">Chrome extension</a></div>
<div class="line">- HTML5 app : coming soon</div>
<div class="line"><br /></div>
</div>
<div class="section" id="why-it-s-cool">
<h3>Why it's cool ?</h3>
<div class="line-block">
<div class="line">- <strong>Syncs</strong> with all your devices of course (and your google tasks too !)</div>
<div class="line">- Very <strong>simple</strong> to use</div>
<div class="line">- Missed a call ? <strong>replan</strong> it !</div>
<div class="line">- <strong>Share</strong> tasks (ie : shopping list)</div>
<div class="line">- <strong>Plan</strong> tasks (with an alarm)</div>
<div class="line">- <strong>Widgets</strong> for your desktop</div>
<div class="line">- and <strong>more</strong></div>
</div>
<p>So, check this out <strong>now on</strong> <a class="reference external" href="http://www.any.do/">Any.do</a> !</p>
<img alt="" src="/images/Any.do-call.png" />
</div>
</div>
How to set up Canon MG3250 printer on Linux2013-01-14T20:39:00+01:00natjohantag:natjohan.info,2013-01-14:how-to-set-up-canon-mg3250-printer-on-linux.html<p>I recently bought a Canon MG3250 printer, this is a classic printer with a good quality price average for home usage (wifi, recto-verso, scan).</p>
<img alt="" src="/images/Canon-mg3250.png" />
<div class="section" id="prerequisites">
<h2>Prerequisites</h2>
<p>So, you have to make the installation of your printer (follow the canon manual), connect to your wifi network with WPS (Wifi Protected Setup)</p>
<!-- -->
<blockquote>
/!\ <strong>Note</strong> : if your router doesn't support WPS functionnality, you have to setup your printer with the installation cd on windows or MacOS.</blockquote>
</div>
<div class="section" id="system-installation">
<h2>System installation</h2>
<dl class="docutils">
<dt>On Fedora, there is tree solutions to configure your printer :</dt>
<dd><ul class="first last simple">
<li>simply connect through the usb cable, and that's it ! the printer is now added and also works through wifi</li>
<li>through wifi, you have to launch <cite>system-config-printer</cite> in your terminal and add the printer</li>
<li>open <a class="reference external" href="http://localhost:631/">http://localhost:631/</a> (it's the web interface for <a class="reference external" href="http://en.wikipedia.org/wiki/CUPS">CUPS</a>) into a browser window and configure your printer from there.</li>
</ul>
</dd>
<dt>Maybe on other distro you have to download and install canon drivers to add and configure the printer :</dt>
<dd><ul class="first last simple">
<li>download the <strong>IJ printer driver</strong> <a class="reference external" href="http://www.canon-europe.com/Support/Consumer_Products/products/Fax__Multifunctionals/InkJet/PIXMA_MG_series/PIXMA_MG3240.aspx?type=download&page=1">here</a> (deb/rpm or source)</li>
<li>decompress with <cite>tar -xvf</cite></li>
<li>in the decompressed folder, install with <cite>sh install.sh</cite> (with root rights) and follow the instructions</li>
</ul>
</dd>
<dt>Everything works well, except the scan function, if you want to use this functionnality, you need scangear :</dt>
<dd><ul class="first last simple">
<li>download <a class="reference external" href="http://www.canon-europe.com/Support/Consumer_Products/products/Fax__Multifunctionals/InkJet/PIXMA_MG_series/PIXMA_MG3240.aspx?type=download&page=1">scangear</a></li>
<li>decompress with <cite>tar -xvf</cite></li>
<li>in the decompressed folder, install with <cite>sh install.sh</cite> (with root rights)</li>
</ul>
</dd>
</dl>
<p>Now you can launch scangear (<cite>scangearmp</cite> command) and launch a scan through wifi.</p>
<p>To add a scangear icon on your gnome shell menu, you should install <strong>alacarte</strong> (if you're on Fedora, there is a fix to run Alacarte : just read my <a class="reference external" href="http://natjohan.info/tip-of-the-week-4.html">ToTW</a> ) which provide a complete and simple menu editor for gnome. Here is my conf for the new entry (the emplacement of scangearmp is : <cite>/usr/local/bin/scangearmp</cite> ,simply show that with <cite>which scangearmp</cite> command) :</p>
<img alt="" src="/images/Alacarte-scan.png" />
<div class="section" id="id1">
<h3></h3>
<blockquote>
<strong>Note</strong> : don't forget to change icon by clicking on the little launcher on the left, you can find a fancy scan icon under gnome/scalable/devices</blockquote>
</div>
</div>
Tip of the week 42013-01-14T19:26:00+01:00natjohantag:natjohan.info,2013-01-14:tip-of-the-week-4.html<div class="section" id="simply-edit-your-gnome-3-menu-with-alacarte">
<h2>Simply edit your Gnome 3 menu with Alacarte</h2>
<img alt="" src="/images/menu-alacarte.png" />
<p>Unfortunately Gnome doesn't provide a simple and well documented way to add/modify a menu entry, however <strong>Alacarte</strong> is a great tool for that.</p>
<div class="section" id="installation">
<h3>Installation</h3>
<p>On Fedora (Alacarte is also available in many distro) :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install alacarte</span>
</pre></div>
<p>To get it works on Fedora (I just tested it on F17), you have to edit <cite>/lib/python2.7/site-packages/Alacarte/MenuEditor.py</cite> and replace <strong>applications.menu</strong> by <strong>applications-gnome.menu</strong> and save it before launch Alacarte</p>
</div>
<div class="section" id="usage">
<h3>Usage</h3>
<p>Now you can add/modify/delete your menu entries with Alacarte (start it with Activities -> Applications or with Alt+f2 -> <cite>Alacarte</cite>)</p>
<img alt="" src="/images/Alacarte-scan.png" />
<div class="section" id="id1">
<h4></h4>
<blockquote>
<strong>Note</strong> : You can change icon by clicking on the little picture on the left</blockquote>
</div>
</div>
</div>
JqPlot : charts and graphs for Jquery2013-01-07T19:11:00+01:00natjohantag:natjohan.info,2013-01-07:jqplot-charts-and-graphs-for-jquery.html<img alt="" src="/images/JqPlot-ex.png" />
<p>You want to add some fancy charts and graph to your webpage, backend...? So, you have to consider Jqplot, it's a JQuery plugin which have many advantages :
- Open source, free to use and maintained by Chris Leonello (<a class="reference external" href="https://bitbucket.org/cleonello/jqplot/overview">Bitbucket page</a>)
- based on JQuery
- highly customizable (bars, pies, lines, colors, axis text, etc)
- well <a class="reference external" href="http://www.jqplot.com/docs/files/usage-txt.html">documented</a></p>
<p>A simple, quick example</p>
<p>In your header :</p>
<div class="highlight"><pre><span class="c"><!-- JQuery --></span>
<span class="nt"><script </span><span class="na">class=</span><span class="s">"include"</span> <span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"YOUR_PATH_TO /jquery.min.js"</span><span class="nt">></script></span>
<span class="c"><!-- Jqplot --></span>
<span class="c"><!--[if lt IE 9]><script src="excanvas.js"></script><![endif]--></span>
<span class="nt"><link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">href=</span><span class="s">"YOUR_PATH_TO jqplot/jquery.jqplot.css"</span> <span class="nt">/></span>
<span class="nt"><script </span><span class="na">src=</span><span class="s">"YOUR_PATH_TO jqplot/jquery.jqplot.min.js"</span><span class="nt">></script></span>
<span class="nt"><script </span><span class="na">src=</span><span class="s">"YOUR_PATH_TO jqplot/plugins/jqplot.canvasTextRenderer.min.js"</span><span class="nt">></script></span>
<span class="nt"><script </span><span class="na">src=</span><span class="s">"YOUR_PATH_TO jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js"</span><span class="nt">></script></span>
<span class="nt"><script </span><span class="na">src=</span><span class="s">"YOUR_PATH_TO jqplot/plugins/jqplot.highlighter.min.js"</span><span class="nt">></script></span>
<span class="nt"><script </span><span class="na">src=</span><span class="s">"YOUR_PATH_TO jqplot/plugins/jqplot.cursor.min.js"</span><span class="nt">></script></span>
</pre></div>
<p>The script part :</p>
<div class="highlight"><pre><span class="o"><</span><span class="nx">script</span> <span class="nx">type</span><span class="o">=</span><span class="s2">"text/javascript"</span><span class="o">></span>
<span class="kd">var</span> <span class="nx">stats</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span><span class="mf">5.2</span><span class="p">],[</span><span class="mi">2</span><span class="p">,</span><span class="mi">6</span><span class="p">],[</span><span class="mi">3</span><span class="p">,</span><span class="mf">4.9</span><span class="p">],[</span><span class="mi">4</span><span class="p">,</span><span class="mf">5.8</span><span class="p">],[</span><span class="mi">5</span><span class="p">,</span><span class="mi">7</span><span class="p">],[</span><span class="mi">6</span><span class="p">,</span><span class="mf">5.3</span><span class="p">],[</span><span class="mi">7</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">8</span><span class="p">],[</span><span class="mi">8</span><span class="p">,</span><span class="mi">6</span><span class="p">],[</span><span class="mi">9</span><span class="p">,</span><span class="mf">6.1</span><span class="p">],[</span><span class="mi">10</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">9</span><span class="p">]];</span>
<span class="nx">$</span><span class="p">(</span><span class="nb">document</span><span class="p">).</span><span class="nx">ready</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span>
<span class="kd">var</span> <span class="nx">plot1</span> <span class="o">=</span> <span class="nx">$</span><span class="p">.</span><span class="nx">jqplot</span> <span class="p">(</span><span class="s1">'bwchart'</span><span class="p">,</span> <span class="p">[</span><span class="nx">stats</span><span class="p">],{</span>
<span class="nx">title</span><span class="o">:</span> <span class="s1">'Bandwidth Report'</span><span class="p">,</span>
<span class="c1">// Turns on animation for all series in this plot.</span>
<span class="nx">animate</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="c1">// Will animate plot on calls to plot1.replot({resetAxes:true})</span>
<span class="nx">animateReplot</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="c1">// Set default options on all series</span>
<span class="nx">seriesDefaults</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">fill</span><span class="o">:</span> <span class="kc">true</span>
<span class="p">},</span>
<span class="c1">// axes specs</span>
<span class="nx">axes</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">xaxis</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">label</span><span class="o">:</span> <span class="s1">'Time in second'</span><span class="p">,</span>
<span class="nx">labelRenderer</span><span class="o">:</span> <span class="nx">$</span><span class="p">.</span><span class="nx">jqplot</span><span class="p">.</span><span class="nx">CanvasAxisLabelRenderer</span><span class="p">,</span>
<span class="nx">pad</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nx">min</span><span class="o">:</span> <span class="mi">0</span>
<span class="p">},</span>
<span class="nx">yaxis</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">label</span><span class="o">:</span> <span class="s1">'Rates in Mbit/s'</span><span class="p">,</span>
<span class="nx">labelRenderer</span><span class="o">:</span> <span class="nx">$</span><span class="p">.</span><span class="nx">jqplot</span><span class="p">.</span><span class="nx">CanvasAxisLabelRenderer</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nx">highlighter</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">show</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nx">sizeAdjust</span><span class="o">:</span> <span class="mf">7.5</span>
<span class="p">},</span>
<span class="nx">cursor</span><span class="o">:</span> <span class="p">{</span>
<span class="nx">show</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nx">zoom</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nx">constrainOutsideZoom</span><span class="o">:</span> <span class="kc">false</span>
<span class="p">}</span>
<span class="p">});</span>
<span class="o"><</span><span class="err">/script></span>
</pre></div>
<p>And the result is</p>
<img alt="" src="/images/jqplotchartexample.png" />
<div class="section" id="go-further">
<h2>Go further</h2>
<ul class="simple">
<li><a class="reference external" href="http://www.jqplot.com/deploy/dist/examples/">JqPlot offical Examples</a></li>
<li><a class="reference external" href="http://www.jqplot.com/docs/files/usage-txt.html">JqPlot documentation</a></li>
</ul>
</div>
Tip of the week 32013-01-07T14:17:00+01:00natjohantag:natjohan.info,2013-01-07:tip-of-the-week-3.html<div class="section" id="test-email-sending-in-local">
<h2>Test email sending in local</h2>
<p>Sometimes, you have to check if your email application works for your devs, but you don't want to importunate your users to test it. So you should test it in local, and verify that emails will be sent to the right people, and that those emails will contain the correct content.
One way to test test it, is to run this python command that run a simple smtp server that receive and display emails locally in your terminal (in this example, the server listening on port 1025)</p>
<div class="highlight"><pre><span class="go">natjohan$ python -m smtpd -n -c DebuggingServer localhost:1025</span>
</pre></div>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<p>Just read the <a class="reference external" href="http://docs.python.org/2.7/library/smtpd.html#smtpd">smtpd python documentation</a></p>
</div>
Tip of the week 22013-01-01T20:03:00+01:00natjohantag:natjohan.info,2013-01-01:tip-of-the-week-2.html<div class="section" id="simply-get-your-public-ip-address-from-command-line">
<h2>Simply get your public ip address from command line</h2>
<p>You want to know your external ip in with command line ? just type :</p>
<div class="highlight"><pre><span class="go">natjohan$ curl ifconfig.me</span>
<span class="go">XX.XX.XX.XX</span>
</pre></div>
<p>If <cite>curl</cite> is not on your system, you can use <cite>wget</cite></p>
<div class="highlight"><pre><span class="go">natjohan$ wget -qO- ifconfig.me/ip</span>
<span class="go">XX.XX.XX.XX</span>
</pre></div>
<!-- Note : you can retrieve other informations like port/user agent/host and xml or json format, read more on `ifconfig.me<http://ifconfig.me/`_ and icanhazip.com also provide your ip address -->
</div>
Tip of the week 12012-12-29T20:17:00+01:00natjohantag:natjohan.info,2012-12-29:tip-of-the-week-1.html<div class="section" id="imagemagick">
<h2>ImageMagick</h2>
<p><em>Who has never needed to change an image to put on a website that accepts only a certain size (i.e. 220x220px) ?</em></p>
<p>ImageMagick is a powerful command line suite tool that allow to resize/convert/compare/composite your pictures, and <a class="reference external" href="http://www.imagemagick.org/script/examples.php">more</a>.</p>
<div class="section" id="installation">
<h3>Installation</h3>
<p>You can download ImageMagick <a class="reference external" href="http://www.imagemagick.org/script/binary-releases.php">here</a>. But it's available in Fedora packets :</p>
<div class="highlight"><pre><span class="go">natjohan# yum install ImageMagick</span>
</pre></div>
<!-- -->
<blockquote>
<strong>Note :</strong> ImageMagick is also available on MacOs, Ios, Win</blockquote>
</div>
<div class="section" id="quick-references">
<h3>Quick references</h3>
<p>Here is some quick reference to use ImageMagick (but you should read the manual with <cite>man imagemagick</cite>) :</p>
<div class="section" id="convert">
<h4>Convert</h4>
<p><strong>Change the size</strong> of a picture (in px), just note that command just <cite>resize</cite> (for crop there is <cite>-crop</cite> option) :</p>
<div class="highlight"><pre><span class="go">natjohan$ convert -resize 220x220 picture.png newsize.png</span>
</pre></div>
<p><strong>Convert</strong> a jpeg image in png (this command works with many format) :</p>
<div class="highlight"><pre><span class="go">natjohan$ convert picture.jpeg picture.png</span>
</pre></div>
<p>Convert a lot of pictures (and keep the same name):</p>
<div class="highlight"><pre><span class="go">natjohan$ convert *.jpeg -set filename:f '%t.png' +adjoin '%[filename:f]'</span>
</pre></div>
<p><strong>resize</strong> your picture before convert :</p>
<div class="highlight"><pre><span class="go">natjohan$ convert picture.jpeg -resize 30% picture.png</span>
</pre></div>
<p><strong>create a pdf</strong> doc with several pictures :</p>
<div class="highlight"><pre><span class="go">natjohan$ convert -compress jpeg picture_*.jpeg mydoc.pdf</span>
</pre></div>
<p><strong>create a gif</strong> with some pictures :</p>
<div class="highlight"><pre><span class="go">natjohan$ convert picture_*.jpeg mybeautifulgif.gif</span>
</pre></div>
<p>note you can adjust delay between each pictures with <cite>-delay 60</cite> (in centisecond)</p>
</div>
<div class="section" id="compare">
<h4>Compare</h4>
<p>You can compare the differences between two or more pictures and show the diff in a third picture:</p>
<div class="highlight"><pre><span class="go">natjohan$ compare picture1.jpg picture2.jpg pictureDiff.jpg</span>
</pre></div>
</div>
<div class="section" id="identify">
<h4>Identify</h4>
<p><strong>Show information</strong> about your picture :</p>
<div class="highlight"><pre><span class="go">natjohan$ identify 1234.JPG</span>
<span class="go">1234.JPG JPEG 1182x1182 1182x1182+0+0 8-bit DirectClass 245KB 0.000u 0:00.000</span>
</pre></div>
<p>for your <strong>scripts</strong>, you can retrieve specific info, example :</p>
<div class="highlight"><pre><span class="go">natjohan$ identify -format "width %w px" 1234.JPG</span>
<span class="go">width 1182 px</span>
</pre></div>
</div>
<div class="section" id="display">
<h4>Display</h4>
<p>You can also use a little GUI for ImageMagick with the <cite>display</cite> command :</p>
<div class="highlight"><pre><span class="go">natjohan$ display picture.jpg</span>
</pre></div>
</div>
</div>
<div class="section" id="go-further">
<h3>Go further</h3>
<p>There is a <a class="reference external" href="http://www.amazon.com/exec/obidos/tg/detail/-/1590595904/qid=1123551819/sr=8-1/ref=pd_bbs_sbs_1?v=glance&s=books&n=507846">book</a> about ImageMagick, yeah !</p>
</div>
</div>
My favorite Gnome Shell Extensions2012-11-28T15:55:00+01:00natjohantag:natjohan.info,2012-11-28:my-favorite-gnome-shell-extensions.html<p>Here is my favorite Gnome Shell extensions :</p>
<div class="section" id="alternative-status-menu">
<h2>Alternative Status menu</h2>
<p>This extension allow to display the power off function in gnome shell status menu (what a bad ergonomic choice of gnome devs !)</p>
<p><a class="reference external" href="https://extensions.gnome.org/extension/5/alternative-status-menu/">Alternative status menu</a></p>
<img alt="alternative status menu enable a switch off button" src="/images/Screenshot-power.png" />
</div>
<div class="section" id="brightness-control">
<h2>Brightness control</h2>
<p>It's a very usefull extension for laptop that allow to control your screen brightness</p>
<p><a class="reference external" href="https://extensions.gnome.org/extension/231/brightness-control/">Brightness control</a></p>
<img alt="simply control your laptop brightness" src="/images/Screenshot-brightness.png" />
</div>
<div class="section" id="place-status-indicator">
<h2>Place Status Indicator</h2>
<p>Simply add an icon for quick folders access</p>
<p><a class="reference external" href="https://extensions.gnome.org/extension/8/places-status-indicator/">Place status indicator</a></p>
<img alt="quick folder access on status menu" src="/images/Screenshot-quick.png" />
</div>
<div class="section" id="status-icon-fixer">
<h2>Status icon fixer</h2>
<p>This extension fix Dropbox icon notifications on status bar</p>
<p><a class="reference external" href="https://extensions.gnome.org/extension/192/status-icon-fixer/">Status icon fixer</a></p>
<img alt="fix dropbox icon" src="/images/Screenshot-notif.png" />
</div>
<div class="section" id="coverflow-alt-tab">
<h2>Coverflow Alt-Tab</h2>
<p>Just a fancy extension to switch between apps with coverflow style</p>
<p><a class="reference external" href="https://extensions.gnome.org/extension/97/coverflow-alt-tab/">Coverflow Alt-Tab</a></p>
<img alt="coverflow in gnome" src="/images/Screenshot-coverflow.png" />
</div>
<div class="section" id="dash-to-dock">
<h2>Dash to dock</h2>
<p>"Transform the dash into an intellihide dock."</p>
<p><a class="reference external" href="https://extensions.gnome.org/extension/307/dash-to-dock/">Dash to dock</a></p>
<img alt="intellihide dock" src="/images/Screenshot-dock.png" />
</div>
<div class="section" id="remove-accessibility">
<h2>Remove accessibility</h2>
<p>"Remove the accessibility button from the top panel."</p>
<p><a class="reference external" href="https://extensions.gnome.org/extension/112/remove-accesibility/">Remove accessibility</a></p>
</div>
<div class="section" id="media-player-indicator">
<h2>Media player indicator</h2>
<p>It allows to control your media player on the status bar via the volume icon</p>
<p><a class="reference external" href="https://extensions.gnome.org/extension/55/media-player-indicator/">Media player indicator</a></p>
<img alt="media player indicator" src="/images/Screenshot-media.png" />
<p>This extensions allow to tweak your gnome shell, but they also show us the importants deficiencies of Gnome shell...</p>
</div>
<div class="section" id="go-further">
<h2>Go Further</h2>
<p>You should look at <a class="reference external" href="https://extensions.gnome.org/">Gnome shell extension page</a></p>
</div>
Linux on Samsung np900x3c2012-11-19T13:47:00+01:00natjohantag:natjohan.info,2012-11-19:linux-on-samsung-np900x3c.html<p>Few month ago I decided to buy a new laptop : the Samsung NP900X3C. It's a sleek, chic piece of hardware. Read more about that in this <a class="reference external" href="http://www.theverge.com/2012/7/16/3160289/samsung-series-9-review-13-inch-mid-2012">review</a> ou <a class="reference external" href="http://www.engadget.com/2012/01/09/redesigned-samsung-series-9-laptop-announced/">here</a>.</p>
<img alt="" src="/images/Samsung-NP900X3C.png" />
<p>As a Linux user, i wanted to put Linux on it. I tried ArchLinux, but unfortunately, it was unstable and there were too many kernel panic. So, I installed Fedora 17 on this laptop, and most things works well out of the box (multitouch trackpad, wireless, sound, graphics, webcam ...).</p>
<p>I just want to post a little fix I found on RedHat BugZilla to make FN keys work for the keyboard backlight.</p>
<ol class="arabic simple">
<li>Create and edit /usr/lib/udev/keymaps/samsung-900x3c</li>
</ol>
<div class="highlight"><pre><span class="c"># /usr/lib/udev/keymaps/samsung-900x3c</span>
0xCE prog1 <span class="c"># FN+F1 System Settings</span>
0x89 brightnessdown <span class="c"># FN+F2 Brightness down</span>
0x88 brightnessup <span class="c"># FN+F3 Brightness up</span>
0x82 switchvideomode <span class="c"># FN+F4 Switch video mode</span>
0xF9 f23 <span class="c"># FN+F5 Turn touchpad off</span>
0xA0 mute <span class="c"># FN+F6 Mute</span>
0xAE volumedown <span class="c"># FN+F7 Volume down</span>
0xB0 volumeup <span class="c"># FN+F8 Volume up</span>
0x97 kbdillumdown <span class="c"># FN+F9 Keyboard backlight down</span>
0x96 kbdillumup <span class="c"># FN+F10 Keyboard backlight up</span>
0xB3 silentmode <span class="c"># FN+F11 Silentmode</span>
0xD5 wlan <span class="c"># FN+F12 WiFi</span>
</pre></div>
<ol class="arabic simple" start="2">
<li>Create and edit /usr/lib/udev/keymaps/force-release/samsung-900x3c</li>
</ol>
<div class="highlight"><pre><span class="c"># /usr/lib/udev/keymaps/force-release/samsung-900x3c</span>
0xCE <span class="c"># FN+F1 System Settings</span>
0x89 <span class="c"># FN+F2 Brightness down</span>
0x88 <span class="c"># FN+F3 Brightness up</span>
0x82 <span class="c"># FN+F4 Switch video mode</span>
0xF9 <span class="c"># FN+F5 Turn touchpad off</span>
0xA0 <span class="c"># FN+F6 Mute</span>
0xAE <span class="c"># FN+F7 Volume down</span>
0xB0 <span class="c"># FN+F8 Volume up</span>
0x97 <span class="c"># FN+F9 Keyboard backlight down</span>
0x96 <span class="c"># FN+F10 Keyboard backlight up</span>
0xB3 <span class="c"># FN+F11 Silentmode</span>
0xD5 <span class="c"># FN+F12 WiFi</span>
</pre></div>
<ol class="arabic simple" start="3">
<li>Edit /usr/lib/udev/rules.d/95-keymap.rules, add following line to the other Samsung specific lines</li>
</ol>
<div class="highlight"><pre>ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, ATTR<span class="o">{[</span>dmi/id<span class="o">]</span>product_name<span class="o">}==</span><span class="s2">"900X3C*"</span>, RUN+<span class="o">=</span><span class="s2">"keymap $name samsung-900x3c"</span>
</pre></div>
<p>Your file might look like this :</p>
<div class="highlight"><pre><span class="o">[</span>...<span class="o">]</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"MAXDATA"</span>, ATTR<span class="o">{[</span>dmi/id<span class="o">]</span>product_name<span class="o">}==</span><span class="s2">"Pro 7000*"</span>, RUN+<span class="o">=</span><span class="s2">"keymap $name maxdata-pro_7000"</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, ATTR<span class="o">{[</span>dmi/id<span class="o">]</span>product_name<span class="o">}==</span><span class="s2">"900X3C*"</span>, RUN+<span class="o">=</span><span class="s2">"keymap $name samsung-900x3c"</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, RUN+<span class="o">=</span><span class="s2">"keymap $name samsung-other"</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, ATTR<span class="o">{[</span>dmi/id<span class="o">]</span>product_name<span class="o">}==</span><span class="s2">"*SX20S*"</span>, RUN+<span class="o">=</span><span class="s2">"keymap $name samsung-sx20s"</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, ATTR<span class="o">{[</span>dmi/id<span class="o">]</span>product_name<span class="o">}==</span><span class="s2">"SQ1US"</span>, RUN+<span class="o">=</span><span class="s2">"keymap $name samsung-sq1us"</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, ATTR<span class="o">{[</span>dmi/id<span class="o">]</span>product_name<span class="o">}==</span><span class="s2">"*700Z*"</span>, RUN+<span class="o">=</span><span class="s2">"keymap $name 0xBA ejectcd 0x96 keyboardbrightnessup 0x97 keyboardbrightnessdown"</span>
<span class="o">[</span>...<span class="o">]</span>
</pre></div>
<ol class="arabic simple" start="4">
<li>Edit /usr/lib/udev/rules.d/95-keyboard-force-release.rules, add following line to the other Samsung specific lines</li>
</ol>
<div class="highlight"><pre>ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, ATTR<span class="o">{[</span>dmi/id<span class="o">]</span>product_name<span class="o">}==</span><span class="s2">"900X3C*"</span>, RUN+<span class="o">=</span><span class="s2">"keyboard-force-release.sh $devpath samsung-900x3c"</span>
</pre></div>
<p>Your file might look like this :</p>
<div class="highlight"><pre><span class="o">[</span>...<span class="o">]</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}=</span><span class="s2">"$attr{[dmi/id]sys_vendor}"</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, ATTR<span class="o">{[</span>dmi/id<span class="o">]</span>product_name<span class="o">}==</span><span class="s2">"900X3C*"</span>, RUN+<span class="o">=</span><span class="s2">"keyboard-force-release.sh $devpath samsung-900x3c"</span>
ENV<span class="o">{</span>DMI_VENDOR<span class="o">}==</span><span class="s2">"[sS][aA][mM][sS][uU][nN][gG]*"</span>, RUN+<span class="o">=</span><span class="s2">"keyboard-force-release.sh $devpath samsung-other"</span>
<span class="o">[</span>...<span class="o">]</span>
</pre></div>
<ol class="arabic simple" start="5">
<li>Just reboot your computer and now most FN keys works except 'silent mode' and wifi switcher</li>
</ol>
<p>May it helps ;)</p>