maintained by Mac-arena the Bored Zo, [email address that no longer works] copyright 2003 Mac-arena the Bored Zo available from [URL no longer works] HTML/PHP version at [URL works but no longer has a mirror] MIRRORS WELCOME! please email me if you want to mirror. some commands submitted by Steve Leopardi [email address deleted], frost, and rajnchaos Linux Cheatsheet IS NOT PUBLISHED BY IDG BOOKS and anyone who says it is is
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SSH_HOST=user@host # Change this accordingly. | |
SSH_PORT=22 # If SSH server is listening on different port, change this. | |
PROXY_INTERFACE="Ethernet" # Change this to Wi-Fi, if you are on wireless, or to whatever your NIC is. | |
PROXY_HOST=localhost # This doesn't change. | |
PROXY_PORT=8080 # Pick a different port if you like. | |
if [[ $1 == "start" ]]; then | |
ssh -D $PROXY_PORT -f -C -q -N $SSH_HOST -p$SSH_PORT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Print a swatch using all 256 colors of 256-color-capable terminals.""" | |
__author__ = "Marius Gedminas <[email protected]>" | |
__url__ = "https://gist.github.com/mgedmin/2762225" | |
__version__ = '2.0' | |
def hrun(start, width, padding=0): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -p get all images, etc. needed to display HTML page. | |
# --mirror turns on recursion and time-stamping, sets infinite | |
# recursion depth and keeps FTP directory listings | |
# --html-extension save HTML docs with .html extensions | |
# --convert-links make links in downloaded HTML point to local files. | |
wget --mirror -p --html-extension --convert-links www.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 | |
file=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On the fly resizing of images inside /images/*/ | |
# based on query string "width" and "height" parameters | |
location ~ /images/(.+)/ { | |
set $width -; | |
set $height -; | |
set $entity $1; | |
if ($arg_width) { | |
set $width $arg_width; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PROVIDE: forever | |
# REQUIRE: NETWORKING SERVERS DAEMON | |
# BEFORE: LOGIN | |
# KEYWORD: shutdown | |
# Taken from http://habrahabr.ru/post/137857/ | |
. /etc/rc.subr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Word and Character Count service for Mac OS X | |
-- Adds a Word and Character Count option to the text selection context menu | |
-- Use Automator to create a new service, then select the Run AppleScript action. Make | |
-- sure the service is set to receive "text", at the top of the window. Paste in this code | |
-- and save as "Word and Character Count". Now switch to a new app, select some text, | |
-- right-click, go to Services, and find the new option. | |
-- Copyright 2015, Noah Slater <[email protected]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
man() { | |
env \ | |
LESS_TERMCAP_md=$'\e[1;36m' \ | |
LESS_TERMCAP_me=$'\e[0m' \ | |
LESS_TERMCAP_se=$'\e[0m' \ | |
LESS_TERMCAP_so=$'\e[1;40;92m' \ | |
LESS_TERMCAP_ue=$'\e[0m' \ | |
LESS_TERMCAP_us=$'\e[1;32m' \ | |
man "$@" | |
} |
OlderNewer