Skip to content

Instantly share code, notes, and snippets.

View lambdalisue's full-sized avatar
🎮

Λlisue (Ali sue・ありすえ) lambdalisue

🎮
View GitHub Profile
@nicoulaj
nicoulaj / build-zsh.sh
Created November 25, 2010 20:19
Build Zsh from sources on Ubuntu
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh
@reu
reu / ssh-copy-id
Created February 3, 2011 13:45
ssh-copy-id
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
@jtriley
jtriley / terminalsize.py
Created July 26, 2011 21:58
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
@lambdalisue
lambdalisue / gist:1145772
Last active September 26, 2015 19:17
Get absolute execution directory path in Sh
#!/bin/sh
# --- long way
ROOT=`dirname $0`
ROOT=`cd $ROOT;pwd`
# --- short way
ROOT=$(cd $(dirname $0);pwd)
# --- with readlink
SELF=$(readlink -f $0)
@lambdalisue
lambdalisue / patch.sh
Created September 18, 2011 15:44
Ubuntu 11.04 Python Image Library (PIL) installation via pip patch
#!/bin/sh
# Ref: http://ubuntuforums.org/showthread.php?t=1751455
# Install required libs
yes | apt-get install build-essential python-dev libjpeg62-dev zlib1g-dev libfreetype6-dev liblcms1-dev
# Link to correct location
if [ -d /usr/lib/x86_64-linux-gnu ]; then
# Ubuntu 11.04 64bit
ln -sf /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/
ln -sf /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/
ln -sf /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/
@lambdalisue
lambdalisue / patch.sh
Created September 20, 2011 17:44
Mac OS X PIL install patch
#!/bin/bash
if [ `which brew` = '' ]; then
echo "You have to install Homebrew first"
exit 1
fi
echo "Installing required packages for PIL..."
brew install libjpeg
brew install https://raw.github.com/yuuna/homebrew/freetype/Library/Formula/freetype2.rb
@lambdalisue
lambdalisue / app_test.py
Created December 24, 2011 08:44
Django TestCase for testing app which depends extra Apps
#!/usr/bin/env python
# vim: set fileencoding=utf8:
"""
TestCase module for testing App
Original code is found at
http://stackoverflow.com/questions/502916/django-how-to-create-a-model-dynamically-just-for-testing
"""
import copy
@lambdalisue
lambdalisue / app_testcase.py
Created January 12, 2012 14:38
Django App TestCase
#!/usr/bin/env python
# vim: set fileencoding=utf8:
"""
Django App TestCase
AUTHOR:
lambdalisue[Ali su ae] (lambdalisue@hashnote.net)
Copyright:
@padde
padde / gist:2623647
Created May 6, 2012 18:23
Convert video for PowerPoint with ffmpeg
ffmpeg -i INFILE -r 25 -f mpeg -vcodec mpeg1video -ar 48000 -b 1500k -acodec mp2 -ar 44100 -ac 1 -y OUTFILE.mpg
@sos4nt
sos4nt / xterm-256color-italic.terminfo
Created July 27, 2012 12:13
A xterm-256color based TERMINFO that adds the escape sequences for italic
# A xterm-256color based TERMINFO that adds the escape sequences for italic.
#
# Install:
#
# tic xterm-256color-italic.terminfo
#
# Usage:
#
# export TERM=xterm-256color-italic
#