Skip to content

Instantly share code, notes, and snippets.

@mcescalante
mcescalante / gist:6803535
Created October 3, 2013 02:02
FreeNAS 8.2 rsync remote to local, non-standard port
#Sync all verbose with progress from remote server to local. This is intended as a one shot sync, not to be scheduled as a cron job. Written for use with FreeNAS 8.2 as non-standard ports take a bit of work to get working.
#XXXX after the p flag should be replaced with the port.
rsync -avPz -e "ssh -pXXXX $portNumber" user@remote:/path/to/files/ /local/path/
@mcescalante
mcescalante / tardaysago.sh
Last active December 25, 2015 02:39
Find files modified since x days ago, tar them
#tar files in current directory modified since 1 day ago
find . -mtime -1 -exec tar --no-recursion -czf name.tgz {} +
@mcescalante
mcescalante / gist:7227148
Created October 30, 2013 04:17
Open manpage and search for string
man foobar | less +/searched_string
@mcescalante
mcescalante / gist:7921270
Created December 12, 2013 00:35
Remove punctuation from python list
#Removes all of the punctuation in any item in a list. The characters to be removed are a string, "punctuation" from your list, "list"
list = [''.join(c for c in s if c not in punctuation) for s in list]
@mcescalante
mcescalante / gist:8809602
Created February 4, 2014 18:36
Force check all filesystems
sudo fsck -Af -M
@mcescalante
mcescalante / gist:10013657
Created April 7, 2014 01:38
List users on FreeBSD box
cat /etc/passwd | cut -d: -f1 | grep -v \#
@mcescalante
mcescalante / gist:10022068
Last active August 29, 2015 13:58
FreeBSD iotop
top -m io -o total #include virtual memory & paging
top -m io #smaller scope
@mcescalante
mcescalante / gist:10097027
Last active August 29, 2015 13:58
pip Xcode clang 3.4 workaround
#Add this line before the "pip install..." command to bypass annoying errors on build with clang 3.4 Xcode tools
ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
@mcescalante
mcescalante / gist:10152645
Created April 8, 2014 16:33
FreeNAS kernel/driver commands
#In order to output all kernel devices, just run this
dmesg
#Alternate
camcontrol devlist
@mcescalante
mcescalante / gist:10916956
Created April 16, 2014 18:24
Count lines of code in directory
find . -name '*.py' | xargs wc -l