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
@thejhh
thejhh / sample.md
Last active July 28, 2018 10:49
zpool logs and cache on zvol

Hardware

  • Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  • 64 G RAM
  • 2x 512 G NVME SSD
  • 2x 10 TB SATA

General setup

  • Swap is 24 GB software RAID-1 md1 (1st partition of NWME)
@thejhh
thejhh / cla.md
Created June 2, 2018 23:15 — forked from kitten/cla.md
MIT CLA

Individual Contributor License Agreement (CLA)

Thank you for submitting your contributions to this project.

By signing this CLA, you agree that the following terms apply to all of your past, present and future contributions to the project.

License.

You hereby represent that all present, past and future contributions are governed by the

@thejhh
thejhh / index.html
Created December 25, 2017 18:47
Silent PHP detection
<html>
<head>
<!-- <?php if (false) { ?> -->
<link rel="stylesheet" href="/loader.css">
<base href="/">
<!-- <?php } else { echo '-'.'->'; ?>
<link rel="stylesheet" href="<?php echo $config['base'];?>loader.css">
<base href="<?php echo $config['base'];?>">
<?php echo '<!--'; } ?> -->
</head>
@thejhh
thejhh / fix-e100.sh
Created February 11, 2017 10:09
Fix rx and tx in e100 network driver with ethtool
#!/bin/bash
# Copyright 2017 Jaakko-Heikki Heusala <jheusala@iki.fi>
# MIT License
#
# Use like:
#
# auto eth0
# iface eth0 inet dhcp
# pre-up /usr/local/sbin/fix-e100.sh eth0
#
# Setup swap file
# Setup non-graphical grub terminal
d-i preseed/late_command string \
mkdir /target/var/swap; \
chmod 700 /target/var/swap; \
dd if=/dev/zero of=/target/var/swap/swapfile0 bs=1M count=1024; \
chmod 600 /target/var/swap/swapfile0; \
mkswap /target/var/swap/swapfile0; \
echo "/var/swap/swapfile0 swap swap defaults 0 0" >> /target/etc/fstab ; \
@thejhh
thejhh / get.js
Last active January 6, 2017 12:18
Sample of Sendanor's backend API framework with Express
"use strict";
var debug = require('nor-debug');
var erp = require('../../erp/index.js');
/** Prepare client object for public view */
function prepare_client(client) {
client = client || {};
debug.assert(client).is('object');
return {
@thejhh
thejhh / ClientCollection.class.php
Created January 5, 2017 19:44
Sample PHP REST Service
<?php
/* Security check */
if (!defined('SendanorERP')) {
die("Direct access not permitted\n");
}
/** Client collection */
class ClientCollection extends DatabaseCollection {
@thejhh
thejhh / Summary.md
Last active December 28, 2016 08:51
Ubuntu 14.04 + zfs + KVM / Free Memory Mystery

System is running Ubuntu 14.04 with 3.19.0-78-generic kernel and locally attached ZFS filesystem (including native root fs).

# free -m
             total       used       free     shared    buffers     cached
Mem:         72484      58779      13705          1          7        136
-/+ buffers/cache:      58634      13849
Swap:        75633          0      75633
# Start
counter = 0
while 1:
try:
counter += 1
print("Start")
node.qemu(vps.vmid).status.start.create()
break
@thejhh
thejhh / .gitignore
Last active August 29, 2015 14:12
Node.js sync file permissions not working
*.txt