Skip to content

Instantly share code, notes, and snippets.

@jalons
jalons / mdadm
Created September 14, 2016 21:44
mdadm fun
ahlee@ipsum:~$ dd if=/dev/zero of=sda bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.998008 s, 1.1 GB/s
ahlee@ipsum:~$ dd if=/dev/zero of=sdb bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.60719 s, 412 MB/s
ahlee@ipsum:~$ sudo losetup /dev/loop0 sda
ahlee@ipsum:~$ sudo losetup /dev/loop1 sdb
@jalons
jalons / hidden
Created September 14, 2016 21:23
32 bit binary on 64 bit OS, terrible error message
(venv)[jeremy.alons@ipsum] ~/m
➜ file ./mdump
./mdump: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, not stripped
(venv)[jeremy.alons@ipsum] ~/m
➜ ./mdump
zsh: no such file or directory: ./mdump

Keybase proof

I hereby claim:

  • I am jalons on github.
  • I am jalons (https://keybase.io/jalons) on keybase.
  • I have a public key ASDJXHgOe5PPSa1vwSR5oMIWQmE2kIvgLfDswtyMWvDHXQo

To claim this, I am signing this object:

@jalons
jalons / 0_reuse_code.js
Created July 2, 2016 02:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jalons
jalons / get_nodegroup_membership.py
Created June 21, 2016 17:06
Get the members of a nodegroup, must be run from the master
#!/usr/bin/env python
import salt.config
import salt.client
opts = salt.config.master_config('/etc/salt/master')
_client = salt.client.LocalClient()
_ret = {}
for _group, _target in opts.get('nodegroups').iteritems():
_ret[_group] = _client.cmd(tgt=_target, fun='test.ping', expr_form='compound').keys()
print _ret
@jalons
jalons / graphite.md
Created November 23, 2015 15:40 — forked from ashrithr/graphite.md
Installing graphite 0.10, collectd and grafana on centos 6

Installing Graphite:

Graphite does two things:

  1. Store numeric time-series data
  2. Render graphs of this data on demand

What Graphite does not do is collect data for you, however there are some tools out there that know

@jalons
jalons / Documentation.md
Last active August 29, 2015 14:27 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@jalons
jalons / flow_chart
Created July 14, 2015 19:52
engineer
+------------+
+Problem-> |
| Engineer +-->Solution
+Coffee--> |
+------+-----+
|
v
Sarcasm
(Side Effect)
git config --global alias.cowsay '!git commit -m "`fortune | cowsay -f tux`"'
reactor:
- 'salt/minion/*/start':
- /srv/reactor/sync_all.sls
- /srv/reactor/graphite_event.sls