Skip to content

Instantly share code, notes, and snippets.

View btbytes's full-sized avatar

Pradeep Gowda btbytes

View GitHub Profile
@btbytes
btbytes / simple_ftp_server.py
Created February 4, 2010 18:41
Simple FTP Server
#!/usr/bin/env python
'''
simple_ftp_server.py
Depends on pyftpdlib - http://code.google.com/p/pyftpdlib/
2010-02-04
'''
from pyftpdlib import ftpserver
authorizer = ftpserver.DummyAuthorizer()
#!/bin/sh
# tarit
# tar a given directory with timestamp.
fname=$1-`date +%Y-%m-%dT%H-%M`.tgz
tar czvf $fname $1
echo
echo $fname
#!/usr/bin/env python3.1
print("ಕನ್ನಡದಲ್ಲಿ ಪೈಥಾನ್ ಪ್ರೊಗ್ರಾಮಿಂಗ್!")
ಹೆಸರುಗಳು = ['ಪ್ರದೀಪ್', 'ನಯನ', 'ಸಿರಿ']
for ಹೆಸರು in ಹೆಸರುಗಳು:
print('ಹಲೋ! ', ಹೆಸರು)
./configure --prefix=$HOME/webapps/enerview --with-apr=$HOME/webapps/enerview/bin/apr-1-config \
--with-apr-util=$HOME/webapps/enerview/bin/apu-1-config --enable-mods-shared=all
./configure --prefix=$HOME/webapps/enerview --with-apxs=$HOME/webapps/enerview/bin/apxs --with-python=/usr/local/bin/python2.6
env CFLAGS=-I/usr/local/pgsql/include LDFLAGS=-L/usr/local/pgsql/lib python2.6 setup.py install --install-lib=$HOME/webapps/enerview/lib/python2.6
@btbytes
btbytes / mysql_csv.sql
Created March 8, 2010 20:46
exporting to CSV from mysql
SELECT * INTO OUTFILE 'result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM my_table;
Sandwiches:
* Jay's Cheesesteaks (many seitan flavors)
* Ike's Place (tons of amazing veggie sandwiches)
* Toaster Oven (Potbelly's clone)
Mexican:
* Papalote (their house salsa is the best IN THE WORLD)
* El Buen Sabor (my favorite super veggie burrito)
* Taqueria Cancún (classic mission burrito; open till 2am on fri/sat, 1am other days, I think)
@btbytes
btbytes / echo.c
Created March 31, 2010 01:37 — forked from paulsmith/echo.c
/**
* A simple preforking echo server in C.
*
* Building:
*
* $ gcc -Wall -o echo echo.c
*
* Usage:
*
* $ ./echo

Installing GPE on Mini2440

setenv ipaddr 10.1.7.68 tftp 0x31000000 10.1.7.66:gpe-image-micro2440.jffs2 nand write.jffs2 0x31000000 root ${filesize} setenv bootargs console=ttySAC0,115200 ip=10.1.7.69 gw=10.1.7.1 mask=255.255.255.0 root=/dev/mtdblock3 mini2440=1tb rootdelay=3 noinitrd setenv bootcmd 'nboot.e kernel ; bootm'

;;rootfstype=jffs2 ;; init=/linuxrc

from datetime import datetime, timedelta
yesterday = (datetime.now() - timedelta(days=1)).strftime('%Y-%m-%d')
today = datetime.now().strftime('%Y-%m-%d')