<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - Juanje</title>
<link>http://snipplr.com/users/Juanje</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sun, 21 Mar 2010 17:31:01 GMT</pubDate>
<item>
<title>(Bash) How to redirect something using sudo</title>
<link>http://snipplr.com/view/8189/how-to-redirect-something-using-sudo/</link>
<description><![CDATA[ <p>Tip from rmartin, but I think I've seen it also on some Ubuntu wiki.</p> ]]></description>
<pubDate>Thu, 04 Sep 2008 10:38:30 GMT</pubDate>
<guid>http://snipplr.com/view/8189/how-to-redirect-something-using-sudo/</guid>
</item>
<item>
<title>(Bash) PPA dput config</title>
<link>http://snipplr.com/view/7282/ppa-dput-config/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 15 Jul 2008 05:13:27 GMT</pubDate>
<guid>http://snipplr.com/view/7282/ppa-dput-config/</guid>
</item>
<item>
<title>(Bash) Import branch on Launchpad bazaar repository</title>
<link>http://snipplr.com/view/7096/import-branch-on-launchpad-bazaar-repository/</link>
<description><![CDATA[ <p>I got problems to push my project to a brand new branch created on Launchpad and this helped me out.
I've already created a new branch on Launchpad and imported my SSH key to be able to use sftp instead the standard 'lp:' (which is alias to http://bazaar.launchpad.net/), because http connections doesn't support mkdirs, so it wouldn't push a project with a directories.

You must change 'myproject' to the name of your register project on Launchpad and 'launchpad_user' to the user with you've registered the project.
This last is just in case your machine user name is different to your launchpad user name. If those are the same you can take off the 'launchpad_user@' stuff between 'sftp://' and 'bazaar.launchpad.net/...'.</p> ]]></description>
<pubDate>Thu, 03 Jul 2008 05:21:48 GMT</pubDate>
<guid>http://snipplr.com/view/7096/import-branch-on-launchpad-bazaar-repository/</guid>
</item>
<item>
<title>(Bash) Tipical bash script option menu</title>
<link>http://snipplr.com/view/6771/tipical-bash-script-option-menu/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 19 Jun 2008 03:05:56 GMT</pubDate>
<guid>http://snipplr.com/view/6771/tipical-bash-script-option-menu/</guid>
</item>
<item>
<title>(Bash) Patch between different directories</title>
<link>http://snipplr.com/view/6667/patch-between-different-directories/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 12 Jun 2008 07:58:42 GMT</pubDate>
<guid>http://snipplr.com/view/6667/patch-between-different-directories/</guid>
</item>
<item>
<title>(Bash) Arrays in BASH</title>
<link>http://snipplr.com/view/6511/arrays-in-bash/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 30 May 2008 19:50:12 GMT</pubDate>
<guid>http://snipplr.com/view/6511/arrays-in-bash/</guid>
</item>
<item>
<title>(Bash) Awk examples</title>
<link>http://snipplr.com/view/6510/awk-examples/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 30 May 2008 19:33:08 GMT</pubDate>
<guid>http://snipplr.com/view/6510/awk-examples/</guid>
</item>
<item>
<title>(Bash) Show few lines from a file with sed</title>
<link>http://snipplr.com/view/6509/show-few-lines-from-a-file-with-sed/</link>
<description><![CDATA[ <p>Some times you need some specific range of lines from a file and the commands 'head' and 'tail' are not enough for you. This could be a easy solution for this problem.</p> ]]></description>
<pubDate>Fri, 30 May 2008 19:01:33 GMT</pubDate>
<guid>http://snipplr.com/view/6509/show-few-lines-from-a-file-with-sed/</guid>
</item>
<item>
<title>(Bash) Vars expansions</title>
<link>http://snipplr.com/view/6508/vars-expansions/</link>
<description><![CDATA[ <p>Sorry, the comentaries are in spanish. I will translate them some day.

The examples results are indicated with:
# -> [result]

Usually is the "echo" result</p> ]]></description>
<pubDate>Fri, 30 May 2008 18:53:12 GMT</pubDate>
<guid>http://snipplr.com/view/6508/vars-expansions/</guid>
</item>
<item>
<title>(Bash) A generic iptables tcp proxy</title>
<link>http://snipplr.com/view/6288/a-generic-iptables-tcp-proxy/</link>
<description><![CDATA[ <p>In the example below, a user may now ssh to $YourIP (1.2.3.4) on $YourPort (port 80) and they'll be transparently redirected to the $TargetIP (2.3.4.5) on the $TargetPort (22). The remote host ($TargetIP) will see the connection as coming from the server doing the forwarding ($YourIP).

Why bother with this at all? Why not just change the port that sshd listens on?

This is useful when a network filters outgoing connections based on destination ports and you don't control the host you want to connect to. If such a network only allowed outgoing connections to port 80, you'd be able to circumvent their filtering. However, if the firewall is doing stateful layer seven inspection, all bets are off. It's trivial to make this work for any other protocol, there is nothing special about ssh - it's just used as an example.

As a general note, this may invite abuse. It is basically a single hop protocol agnostic TCP proxy in kernel space. It's fast and useful though. You may want to restrict forwarding by source IP addresses if you're worried about letting anyone using you as a single hop bounce. I'll leave that as an exercise for the comments. 

Posted by JacobAppelbaum on Tue 13 May 2008 on www.debian-administration.org</p> ]]></description>
<pubDate>Mon, 19 May 2008 02:17:34 GMT</pubDate>
<guid>http://snipplr.com/view/6288/a-generic-iptables-tcp-proxy/</guid>
</item>
<item>
<title>(Bash) Reverse ssh tunnel</title>
<link>http://snipplr.com/view/6220/reverse-ssh-tunnel/</link>
<description><![CDATA[ <p>This is very useful with dinamic IP connections. You can connect from the host with the dinamic IP, leave the tunnel open to other machine with ssh access and fixed IP and then connect to this machine on specific port (22000 in the example) to connect to the host with dinamic IP.

Also it can be useful in case you need access to a host which is inside a local network and you can't access from outside, but from this host you can connect to outside.</p> ]]></description>
<pubDate>Wed, 14 May 2008 03:52:34 GMT</pubDate>
<guid>http://snipplr.com/view/6220/reverse-ssh-tunnel/</guid>
</item>
<item>
<title>(Bash) Rename debian/ubuntu backport packages</title>
<link>http://snipplr.com/view/6218/rename-debianubuntu-backport-packages/</link>
<description><![CDATA[ <p>This script goes to the directory you pass as a parameter and change de version of all the packages found in there.
It was used for an amount of packages which were building from the sources but for an lower version of Ubuntu (actually for Guadalinex v4 which codename is 'toro'. That's why in variable 'backport' says 'toro').
The code wasn't touched so we didn't change the 'debian/changelog' and the packages were generates with its normal version.
The problem is the packages were compiled with lower version of libraries than the Ubuntu version the packages was saying.
To avoid binary problems and mark those packages as a 'backport' we changed the packages version after the generation with dpkg-deb.

It's quite nasty stuff, but was useful and maybe it could help some one on similar purposes. Also it could be a shellscripting example for more things (var expansions, for example)</p> ]]></description>
<pubDate>Wed, 14 May 2008 03:10:07 GMT</pubDate>
<guid>http://snipplr.com/view/6218/rename-debianubuntu-backport-packages/</guid>
</item>
<item>
<title>(Bash) Quick remastering of a Ubuntu based Live iso</title>
<link>http://snipplr.com/view/6216/quick-remastering-of-a-ubuntu-based-live-iso/</link>
<description><![CDATA[ <p>This is a simple script for testing changes in a live iso created with squashfs filesystem for the compression.
It will take the iso path as a parameter and it will open it up with unionfs to let you modify its content (into a chroot enviroment) and when you get out, it will create a new iso file with the new content.

It's pretty simple and easy stuff but useful for every day testing.</p> ]]></description>
<pubDate>Wed, 14 May 2008 02:28:49 GMT</pubDate>
<guid>http://snipplr.com/view/6216/quick-remastering-of-a-ubuntu-based-live-iso/</guid>
</item>
<item>
<title>(Bash) Get sort url from tinyurl.com</title>
<link>http://snipplr.com/view/6215/get-sort-url-from-tinyurlcom/</link>
<description><![CDATA[ <p>Little script which call tinyurl.com via 'curl' for generate a sort url of the url you pass.</p> ]]></description>
<pubDate>Wed, 14 May 2008 02:11:49 GMT</pubDate>
<guid>http://snipplr.com/view/6215/get-sort-url-from-tinyurlcom/</guid>
</item>
<item>
<title>(Bash) Alias for mounting loop devices</title>
<link>http://snipplr.com/view/6214/alias-for-mounting-loop-devices/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 14 May 2008 01:55:42 GMT</pubDate>
<guid>http://snipplr.com/view/6214/alias-for-mounting-loop-devices/</guid>
</item>
<item>
<title>(Bash) Get the linux modules for our pci devices</title>
<link>http://snipplr.com/view/6155/get-the-linux-modules-for-our-pci-devices/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 08 May 2008 21:12:45 GMT</pubDate>
<guid>http://snipplr.com/view/6155/get-the-linux-modules-for-our-pci-devices/</guid>
</item>
<item>
<title>(Bash) Get (just) the IP address in Linux</title>
<link>http://snipplr.com/view/6154/get-just-the-ip-address-in-linux/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 08 May 2008 20:41:07 GMT</pubDate>
<guid>http://snipplr.com/view/6154/get-just-the-ip-address-in-linux/</guid>
</item>
<item>
<title>(Bash) Delete specific line from a file with sed</title>
<link>http://snipplr.com/view/6152/delete-specific-line-from-a-file-with-sed/</link>
<description><![CDATA[ <p>For deleting a line from a file without open the file you can use sed.

For example, it has been very useful many times for me after anoying messages from ssh when a host I use to connect change the IP...

And sometimes you don't know the line number but you know a specific word from this line.</p> ]]></description>
<pubDate>Thu, 08 May 2008 19:22:02 GMT</pubDate>
<guid>http://snipplr.com/view/6152/delete-specific-line-from-a-file-with-sed/</guid>
</item>
</channel>
</rss>