Skip to content

Instantly share code, notes, and snippets.

View jyap808's full-sized avatar

Julian Y jyap808

View GitHub Profile
@jyap808
jyap808 / gist:8924735
Created February 10, 2014 21:39
MySQLDump one INSERT statement for each data row
@jyap808
jyap808 / People_laurenz_dislikes.md
Last active August 29, 2015 13:56
People Laurenz dislikes
  • Kanye West
  • Edward Snowden
  • Floyd Mayweather Jr.
  • Jay Z
  • Uwe Bowell
  • WS Anderson
@jyap808
jyap808 / gist:8963001
Created February 12, 2014 19:40
Finding iowait culprits

As root:

/etc/init.d/syslog stop
echo 1 > /proc/sys/vm/block_dump
dmesg | egrep "READ|WRITE|dirtied" | egrep -o '([a-zA-Z]*)' | sort | uniq -c | sort -rn | head

Sample output

@jyap808
jyap808 / keybase.md
Created April 2, 2014 20:37
Keybase verification

Keybase proof

I hereby claim:

  • I am jyap808 on github.
  • I am jyap (https://keybase.io/jyap) on keybase.
  • I have a public key whose fingerprint is 685B 5017 6420 1448 6543 0475 C3BD 0552 7F66 1F0A

To claim this, I am signing this object:

@jyap808
jyap808 / Shrink MongoDB journal files.md
Created April 8, 2014 20:46
Shrink MongoDB journal files

In the MongoDB configuration file add the following line:

smallfiles=true

The safety shut off MongoDB and remove the journal files.

Full procedure:

@jyap808
jyap808 / mapCheckpoints and mapStakeModifierCheckpoints.md
Created June 12, 2014 06:46
mapCheckpoints and mapStakeModifierCheckpoints
@jyap808
jyap808 / codesign_verify.md
Last active August 29, 2015 14:03
Mac OS X Verify applications signature
$ codesign -dvvv Bitcoin-Qt.app
Executable=/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt
Identifier=org.bitcoinfoundation.Bitcoin-Qt
Format=bundle with Mach-O thin (x86_64)
CodeDirectory v=20100 size=153121 flags=0x0(none) hashes=7649+3 location=embedded
Hash type=sha1 size=20
CDHash=68b2974f209336f9b90a2435768a0ebac4d3b945
Signature size=8544
Authority=Developer ID Application: BITCOIN FOUNDATION, INC., THE
@jyap808
jyap808 / swap_file.md
Created August 6, 2014 06:56
Create file system swap file
sudo dd if=/dev/zero of=/mnt/myswapfile bs=1M count=1024
ls -l /mnt/myswapfile
sudo chmod 600 /mnt/myswapfile
sudo mkswap /mnt/myswapfile
sudo swapon /mnt/myswapfile

sudo vi /etc/fstab
@jyap808
jyap808 / gist:d69f29e4aefcc6723476
Created August 10, 2014 02:57
Onename.io verification
Verifying myself: My Bitcoin username is +jyap. https://onename.io/jyap
@jyap808
jyap808 / AWS swap file.md
Created November 30, 2014 05:29
AWS swap file

Swap should take place on the Instance Storage (ephemeral) disk and not an EBS device. Swapping will cause a lot of IO and will increase cost on EBS. EBS is also slower than the Instance Store and the Instance Store comes free with the EC2 Instance.

It will usually be mounted to /mnt but if not run

sudo mount /dev/xvda2 /mnt

To then create a swap file on this device do the following for a 4GB swapfile