Skip to content

Instantly share code, notes, and snippets.

@avilshadow
avilshadow / yosemite ntfs read+write.txt
Created February 15, 2016 13:05 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
get every 1000th line from file
awk '!(NR % 1000)' withFid.tsv >> cut.tsv
split line with tab symbol and 12th filed not empty
awk -F'\t' '$12!="" {print $0}' 151009_04-1.tsv >> withFid.tsv
http://www.xtuple.org/PostgresOnLinuxServer
http://stackoverflow.com/questions/3004523/postgresql-database-default-location-on-linux
@avilshadow
avilshadow / gist:62851240d780fbbdf9c5
Created December 18, 2014 12:34
java UTF-8 conversions
StringEntity stringentity = new StringEntity(new String( corruptedString.getBytes()));
will show you what charset used: text/plain; charset=ISO-8859-1
String subjUTF8 = new String(corruptedString.getBytes("ISO-8859-1"), "UTF-8");
will make corrupted utf-8 look pretty

#####change timezone on linux sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime

#####sftp with alias from ssh.config sftp uat-gdn03:/home/ec2-user/node3.tar


#####__TAR__ Tar Usage and Options c – create a archive file.
forward mongo to localhost
ssh -L 27017:localhost:27017 user@remoteMongoHost
ssh -L [localPort]:localhost:[remotePort] user@remoteMongoHost
@avilshadow
avilshadow / gist:87bff7ea88edad1272a7
Created June 2, 2014 09:07
hints with linux services
service --status-all | grep ntpd
or ls /etc/init.d/
//special for mac
launchctl load /Library/LaunchDaemons/com.apple.blabla.plist
@avilshadow
avilshadow / mongodb.md
Last active August 29, 2015 14:01
mongo commands

mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

:mongodump --host [ip] --db [db_name] --port 27017 --out dbName.dump mongodump --host=[ip]:27017 --out=/media/backup/2014-06-06_11h00m --oplog

:mongorestore --db [ToDatabaseName] dumpDirectory.dump/ mongorestore --oplogReplay

if restore error do: export LC_ALL="en_US.UTF-8"

tmux cheatsheet

As configured in my dotfiles.

start new with session name:

tmux new -s myname

attach to named:

tmux a -t myname