Skip to content

Instantly share code, notes, and snippets.

View thejhh's full-sized avatar
💭
Excellence isn't believing you're best; It's about always striving to get better

Jaakko Heusala thejhh

💭
Excellence isn't believing you're best; It's about always striving to get better
View GitHub Profile
23:05:55 < meton> vois ostaa uutta levyäö
23:06:01 < meton> joku pariterainen tuohon
23:06:09 < Iltsu> huonoo aikaa laukes ku nyt o kallist levyy
23:06:11 < meton> no ei nyt niin järjettömän
23:06:16 < meton> wut
23:06:17 <@jhh> oletko katsonut hintoja?
23:06:42 < meton> FUUUUUUUUUUUUUUUUUUUU

Domain Inquiry:

Hello,

My name is Jenna W*** and I'm a Domain Portfolio Manager. I am working on
behalf of the owner of ***.com to sell this domain name.

While performing research online I came across your domain ***.com
; since both domains have listings under a related keyword I thought that your

company may be interested in acquiring?

@thejhh
thejhh / TabsAndSpaces.js
Created November 27, 2011 10:52
Example of right use of tabs with spaces.
/* Example of using tabs to indent and spaces to pad */
function test() {
var a = 1,
b = 'Hello';
}
<VirtualHost 188.64.1.74:443>
ServerName svn.sendanor.fi
SSLEngine on
SSLCertificateFile ssl/cert.pem
SSLCertificateKeyFile ssl/key.pem
ServerAdmin [email protected]
# SVN
<Location /svn>
DAV svn
@thejhh
thejhh / gist:1569747
Created January 6, 2012 08:44
Results of fsck
# fsck /dev/mapper/loop0p1
fsck 1.41.3 (12-Oct-2008)
e2fsck 1.41.3 (12-Oct-2008)
/dev/mapper/loop0p1: recovering journal
/dev/mapper/loop0p1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 525086 has zero dtime. Fix<y>? yes
Inodes that were part of a corrupted orphan linked list found. Fix<y>? yes
@thejhh
thejhh / install-pubkey.sh
Created January 6, 2012 12:07
Script to install pubkey on remote SSH server
#!/bin/sh
# Copyright 2008 Jaakko Heusala <[email protected]>
# Sat, 17 May 2008 17:36:40 +0300
id_rsa_pub_file=".ssh/id_rsa.pub"
for host in "$@"; do
if test -f "$host"; then
id_rsa_pub_file="$host"
continue
fi
echo "$host: Installing $id_rsa_pub_file..."
@thejhh
thejhh / fixed.txt
Created January 14, 2012 14:12
Performance tests for VIA ARTiGO A2000 Storage Server
$ wget -O /dev/null http://s01/jhh/1G.dat
--2012-01-16 17:11:25-- http://s01/jhh/1G.dat
Resolving s01... 192.168.1.67
Connecting to s01|192.168.1.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/x-ns-proxy-autoconfig]
Saving to: “/dev/null”
@thejhh
thejhh / ram-leaking.md
Created January 24, 2012 20:42
Testing btrfs snapshots and git on ramdisk (tmpfs)

Why does deleting a snapshot increase the used space on btrfs filesystem?

# time ./transaction-test.sh
DEBUG   452     work_begin: before snapshot creation
DEBUG   452     snapshot_create: before sync
DEBUG   408     snapshot_create: before snapshot creation
DEBUG   412     snapshot_create: after snapshot creation
DEBUG   412     work_begin: before changing pwd
DEBUG   412     work_begin: after changing pwd
DEBUG 412 do_test: before test
mysql> SELECT * FROM freeciv_client_unitlog;
+------------+---------------------+-----------+--------+--------+------------------+---------+--------------+---------+
| unitlog_id | created | unit_name | unit_x | unit_y | player_name | unit_hp | unit_veteran | unit_id |
+------------+---------------------+-----------+--------+--------+------------------+---------+--------------+---------+
| 1 | 0000-00-00 00:00:00 | Trireme | 60 | 1 | Domenico Fattori | 10 | 0 | 164 |
| 2 | 0000-00-00 00:00:00 | Trireme | 67 | 14 | Domenico Fattori | 10 | 1 | 397 |
| 3 | 0000-00-00 00:00:00 | Trireme | 66 | 15 | Domenico Fattori | 10 | 1 | 397 |
| 4 | 0000-00-00 00:00:00 | Trireme | 65 | 16 | Domenico Fattori | 10 | 1 | 397 |
+------------+---------------------+-----------+--------+--------+------------------+---------+--------------+---------+
4 rows in s

Funny thing with json_decode...

$ php
<?php echo var_export(json_decode("true ", true), true) ?>
NULL

(Press ctrl-d after you write "?>".)

The same using node.js: