Skip to content

Instantly share code, notes, and snippets.

View tlatsas's full-sized avatar

Tasos Latsas tlatsas

View GitHub Profile
@tlatsas
tlatsas / dmesg.log
Created February 16, 2014 11:19
hdtv usb stick
[ 43.123886] ehci-pci 0000:00:1d.0: setting latency timer to 64
[ 43.337450] usb 2-1.2: new high-speed USB device number 5 using ehci-pci
[ 43.464032] dvb-usb: found a 'Pinnacle PCTV Hybrid Stick Solo' in cold state, will try to load a firmware
[ 43.464514] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw'
[ 43.666864] dib0700: firmware started successfully.
[ 44.167661] dvb-usb: found a 'Pinnacle PCTV Hybrid Stick Solo' in warm state.
[ 44.167737] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 44.167843] DVB: registering new adapter (Pinnacle PCTV Hybrid Stick Solo)
[ 44.997111] usb 2-1.2: DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)...
[ 45.001678] xc4000 9-0061: creating new instance
@tlatsas
tlatsas / PKGBUILD
Created December 10, 2013 18:11
python 2.6.9 PKGBUILD
# Contributor: Chris McDonald <[email protected]>
pkgname=python26
pkgver=2.6.9
pkgrel=1
_pybasever=2.6
pkgdesc="A high-level scripting language"
arch=('i686' 'x86_64')
license=('PSF')
url="http://www.python.org/"
@tlatsas
tlatsas / readline.txt
Created December 9, 2013 13:43
Readline Emacs Editing Mode Cheat Sheet
.---------------------------------------------------------------------------.
| |
| Readline Emacs Editing Mode |
| Default Keyboard Shortcut |
| Cheat Sheet |
| |
'---------------------------------------------------------------------------'
| Peteris Krumins ([email protected]), 2007.10.30 |
| http://www.catonmat.net - good coders code, great reuse |
| |
#!/bin/sh
#Get the first IP from ifconfig. Ignore loopback.
SYSIP=$(ifconfig | awk -F'[: ]+' '/inet addr/ {print $4}' | grep -v "127.0.0.1" | head -n1)
if [ -z "${SYSIP}" ]; then
#THE SKY IS FALLING!
#Okay, not really. Couldn't determine IP address.
TEXT="To configure networking, login as 'root' and run the \`setup\` command."
else
@tlatsas
tlatsas / rpmsetup.sh
Created November 29, 2013 12:13
build each package in its own rpmbuild folder
#!/bin/bash
if [[ -z $1 ]]; then
echo "usege: $0 new|link <build>";
exit 1
fi
if [[ -z $2 ]]; then
echo "build name required"
exit 2
fi
# Maintainer: Luis Henrique Mello <[email protected]>
pkgname=gpodder3
_pkgname=gpodder
pkgver=3.5.2
pkgrel=1
pkgdesc='A podcast receiver/catcher'
license=('GPL3')
arch=('any')
url='http://gpodder.org/'
$ ipcalc 169.254.245.127/255.255.0.0
Address: 169.254.245.127 10101001.11111110. 11110101.01111111
Netmask: 255.255.0.0 = 16 11111111.11111111. 00000000.00000000
Wildcard: 0.0.255.255 00000000.00000000. 11111111.11111111
=>
Network: 169.254.0.0/16 10101001.11111110. 00000000.00000000
HostMin: 169.254.0.1 10101001.11111110. 00000000.00000001
HostMax: 169.254.255.254 10101001.11111110. 11111111.11111110
Broadcast: 169.254.255.255 10101001.11111110. 11111111.11111111
Hosts/Net: 65534 Class B, APIPA
@tlatsas
tlatsas / send-fax.sh
Created November 8, 2013 14:29
hylafax
sendfax -x "Test" -r "Subject test" -c "Comment test" -D -h localhost:4559 -d 055 fax000000007.tif
@tlatsas
tlatsas / rchmod.py
Created September 13, 2013 12:57
chmod -R in python
#!/usr/bin/env python
import os
def rchmod(path, dmode, fmode):
for root, dirs, files in os.walk(path):
for _dir in dirs:
os.chmod(os.path.join(root, _dir), dmode)
for _file in files:
os.chmod(os.path.join(root, _file), fmode)
@tlatsas
tlatsas / inpath.sh
Created September 12, 2013 12:46
return the location of a binary by searching in $PATH
#!/bin/bash
[[ -z $1 ]] && { echo "usage: inpath <filename>"; exit 1; }
for path in ${PATH//:/ }; do
if [[ -e "$path/$1" ]]; then
echo "$path/$1" && exit 0
fi
done
echo "$1 not in \$PATH" && exit 1