Skip to content

Instantly share code, notes, and snippets.

View aurora's full-sized avatar
🤔
...

Harald Lapp aurora

🤔
...
View GitHub Profile
@aurora
aurora / nord_modular_osx.md
Created April 26, 2017 21:02 — forked from arirusso/nord_modular_osx.md
Use the original Nord Modular Editor with OSX

Use the original Nord Modular Editor with OSX

Required

  • Homebrew

Compatibility

Confirmed working with

@aurora
aurora / gist:8d01a978a8dc2717c3d938826a3ce4cc
Last active April 26, 2017 10:19
Reminder for creating Let's encrypt certificates
certbot-auto certonly --webroot --agree-tos --non-interactive --text --rsa-key-size 4096 \
--email [email protected] \
--webroot-path /var/www/... \
--domains "www.example.org,example.org"
----test.php----
<?php
class tpl {
protected $data = array();
public function set($name, $value) {
$this->data[$name] = $value;
}
@aurora
aurora / nim-install.sh
Last active March 19, 2016 19:15
Installer for nim development version
#!/usr/bin/env bash
tmpdir=$(mktemp -t /tmp)
cd $tmpdir
git clone -b devel git://github.com/nim-lang/Nim.git
cd Nim
git clone -b devel --depth 1 git://github.com/nim-lang/csources
cd csources && sh build.sh
harald@vserver:~$ sudo tcptraceroute www.shutterstock.com 80 && curl -i -v http://www.shutterstock.com/
traceroute to www.shutterstock.com (162.212.41.11), 30 hops max, 60 byte packets
1 10.1.0.1 (10.1.0.1) 0.308 ms 0.417 ms 0.593 ms
2 host-82-135-34-201.customer.m-online.net (82.135.34.201) 5.397 ms 5.456 ms 5.622 ms
3 mnet-gw.muc1.erdenreich.net (88.217.173.181) 5.673 ms 5.731 ms 5.797 ms
4 ae2.rt-decix-2.m-online.net (82.135.16.209) 10.357 ms 10.560 ms 12.045 ms
5 blackhole.prolexic.com (80.81.193.70) 12.617 ms 12.757 ms 13.042 ms
6 unknown.prolexic.com (72.52.48.35) 13.330 ms 9.100 ms 9.425 ms
7 * * *
8 unknown.prolexic.com (209.200.160.162) 104.824 ms 102.836 ms 103.494 ms
config_files = Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf")
config_files.each do |file|
certificate_files = ['ca', 'cert', 'key', 'tls-auth']
config_dir = File.dirname(file)
connection_name = nil
new_config = []
File.open(file).each do |line|
if line.start_with?('#viscosity name')
@aurora
aurora / gist:6769307
Created September 30, 2013 20:01
Brother HL-5140 Trommelreset
Frontklappe öffnen
Taste "GO" festhalten bis alle Lampen leuchten
Frontklappe schliessen
3x GO drücken
$_t = preg_replace('/((^| )([a-z]:|)\d+([^\w]|$)|[\x21-\x2f\x5b-\x60\x7b-\xff])/i', '', trim($_t));
harald@********:~/ioping-0.6$ ./ioping -c 10 .
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=1 time=2.8 ms
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=2 time=2.0 ms
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=3 time=1.0 ms
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=4 time=5.7 ms
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=5 time=1.0 ms
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=6 time=6.9 ms
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=7 time=1.0 ms
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=8 time=2.7 ms
4096 bytes from . (ext4 /dev/disk/by-uuid/a6d22aee-c0b7-401d-b1be-3c0e0a6205e2): request=9 time=3.0 ms
SUMMARY
I like to use kcachegrind for doing profiling on my ruby code. Most of my development
is done on OSX, and while you can install kcachegrind via macports, it takes forever
because it has to build KDE, as well. Much to my surprise, the fine folks who
wrote kcachegrind also made a QT version, qcachegrind. I was able to build this on
OSX without too much effort, only having to install QT and GraphViz. Yippie!
I'm running OSX 10.6.7, with Xcode 4. My default gcc/g++ version is 4.2. I'm sure
it will build just fine on earlier versions of Xcode, but I haven't tested it.