Skip to content

Instantly share code, notes, and snippets.

View luisuribe's full-sized avatar

Luis Uribe luisuribe

View GitHub Profile
svn propset svn:ignore '*' sess/
:%s/^M//g (To get ^M: ctrl+V ctrl+M)
@luisuribe
luisuribe / Grep Shortcuts
Created November 5, 2009 16:59
grep shortcuts
// Find strings on file
egrep --color '^string1|^string2' file
// Another grep
@luisuribe
luisuribe / ssh tunnel for psql
Created November 9, 2009 02:40
ssh shortcuts
$ ssh -L 3333:remote-host:5432 remote-host
@luisuribe
luisuribe / oracle shortcuts
Created December 8, 2009 07:13
Oracle shortcuts
-- Show all tables
> SELECT TABLE_NAME FROM TABS
-- List fields from a table
> SELECT *
FROM user_tab_cols
WHERE table_name = 'table_name'
-- List some fields fields from a table
> SELECT column_name, data_type, FROM user_tab_cols WHERE table_name = 'table_name'
@luisuribe
luisuribe / Debian packaging shortcuts
Created December 14, 2009 03:22
Debian packaging shortcuts
// Lintian checks
lintian -IivEcm --pedantic *.changes
// Build twice in a row
09:13 < jwilk> xnox: "debian rules binary && debian/rules clean && debian/rules binary"
09:13 < jwilk> xnox: Or, alternatively: "dpkg-buildpackage && dpkg-buildpackage"
09:13 < jwilk> xnox: Or: "pbuilder --build --twice /path/to/.dsc"
$ sudo DIST=sid pbuilder create
$ sudo DIST=sid pbuilder build *dsc
@luisuribe
luisuribe / CSS Help
Created December 14, 2009 04:58
CSS Help
margin: top, right, bottom, left;
@luisuribe
luisuribe / shell shortcuts
Created January 1, 2010 16:20
shell shortcuts
// Empty a file from the command line
$ cat /dev/null > t
// Use last parameter
$ ls /home/acme/norad
$ rm !$
#Send a file as an attachment (ssmtp previously configured)
mpack -s "Un subject" un_fichero mailto:[email protected] [email protected]
<?php
/**
*
* @author nebiros
*/
class App_Util
{
public function cleanUpText( $input, $lowercase = true, $glue = "-" )
{
#!/usr/bin/env python
import paramiko
paramiko.util.log_to_file('/tmp/paramiko.log')
host = "example.com"
port = 22
transport = paramiko.Transport((host, port))
username = "root"
password = "g00d"
transport.connect(username = username, password = password)
filepath = '/tmp/log.log'