Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
🐧
Have you built a Linux kernel recently?

Krzysztof Wilczyński kwilczynski

🐧
Have you built a Linux kernel recently?
  • Yokohama, Japan
  • 01:10 (UTC +09:00)
View GitHub Profile
@kwilczynski
kwilczynski / gist:1160615
Created August 21, 2011 13:27
Build .deb packages ...
krzysztof@ubuntu:~$ gem install fpm --user-install
Successfully installed fpm-0.3.7
1 gem installed
Installing ri documentation for fpm-0.3.7...
Installing RDoc documentation for fpm-0.3.7...
krzysztof@ubuntu:~$ mkdir gems ; gem install fpm net-ping --install-dir ./gems
Building native extensions. This could take a while...
Successfully installed json-1.5.3
Successfully installed fpm-0.3.7
kwilczynski@ubuntu:~$ dpkg -c mongodb-10gen_1.8.3_amd64.deb
drwxr-xr-x root/root 0 2011-08-22 07:33 ./
drwxr-xr-x root/root 0 2011-08-22 07:33 ./usr/
drwxr-xr-x root/root 0 2011-08-22 07:33 ./usr/sbin/
drwxr-xr-x root/root 0 2011-08-22 07:33 ./usr/bin/
-rwxr-xr-x root/root 7750904 2011-08-22 07:33 ./usr/bin/mongofiles
-rwxr-xr-x root/root 7816824 2011-08-22 07:33 ./usr/bin/mongostat
-rwxr-xr-x root/root 7746840 2011-08-22 07:33 ./usr/bin/mongoexport
-rwxr-xr-x root/root 7738808 2011-08-22 07:33 ./usr/bin/bsondump
-rwxr-xr-x root/root 7759096 2011-08-22 07:33 ./usr/bin/mongorestore
kwilczynski@ubuntu:~/Development/Sandbox$ dpkg --info mongodb_1.8.3_amd64.deb
new debian package, version 2.0.
size 19823996 bytes: control archive= 2870 bytes.
41 bytes, 2 lines conffiles
1261 bytes, 26 lines control
1454 bytes, 24 lines md5sums
1720 bytes, 64 lines * postinst #!/bin/sh
921 bytes, 39 lines * postrm #!/bin/sh
1283 bytes, 51 lines * preinst #!/bin/sh
1049 bytes, 47 lines * prerm #!/bin/sh
@kwilczynski
kwilczynski / gist:1170253
Created August 25, 2011 08:43
Usage of resolve_source
How to fall-back to template when the source file is not present on the Puppet Master?
$file = '/tmp/file.txt'
$source = resolve_source("puppet://test/file.txt.${fqdn}",
"puppet://test/file.txt.${domain}",
'puppet://test/file.txt')
if empty($source) {
file { $file:
@kwilczynski
kwilczynski / gist:1170467
Created August 25, 2011 11:29
Upstart configutation file for MongoDB with NUMA support
# Move open file descriptors limit up.
limit nofile 32768 32768
# Wait 300 seconds (5 minutes) before issuing a kill ...
kill timeout 300
pre-start script
# Basic house keeping ...
mkdir -p /var/lib/mongodb &> /dev/null
mkdir -p /var/log/mongodb &> /dev/null
@kwilczynski
kwilczynski / gist:1170477
Created August 25, 2011 11:34
Logrotate configuration for MongoDB
/var/log/mongodb/mongodb.log
{
daily
rotate 7
copytruncate
notifempty
missingok
compress
sharedscripts
postrotate
@kwilczynski
kwilczynski / ip_vs_ftp.c
Created September 1, 2011 00:12
Add support for module parameters under /sys ...
--- ip_vs_ftp.c.orig 2011-08-30 21:34:43.769232489 +0100
+++ ip_vs_ftp.c 2011-08-30 22:12:31.193230337 +0100
@@ -52,8 +52,10 @@
* List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper
* First port is set to the default port.
*/
+static unsigned int ports_count = 0;
static unsigned short ports[IP_VS_APP_MAX_PORTS] = {21, 0};
-module_param_array(ports, ushort, NULL, 0);
+
kwilczynski@ubuntu:~/Development/Sandbox$ fpm -t deb -s dir -n test-project -a all -v 1.0.0 --iteration 1 ./test
Created /home/kwilczynski/Development/Sandbox/test-project_1.0.0-1_all.deb
kwilczynski@ubuntu:~/Development/Sandbox$ dpkg -c test-project_1.0.0-1_all.deb
drwxr-xr-x root/root 0 2011-08-16 16:34 ./test/
drwxr-xr-x root/root 0 2011-08-16 16:34 ./test/operations/
drwxr-xr-x root/root 0 2011-08-16 10:57 ./test/operations/a/
-rw-r--r-- root/root 0 2011-08-16 10:57 ./test/operations/a/foo
drwxr-xr-x root/root 0 2011-08-16 10:57 ./test/operations/b/
-rw-r--r-- root/root 0 2011-08-16 10:57 ./test/operations/b/bar
drwxr-xr-x root/root 0 2011-08-12 10:24 ./test/operations/c/
@kwilczynski
kwilczynski / 1
Created September 20, 2011 13:49
MongoDB issues
dbpath=/var/lib/mongodb
directoryperdb=true
replSet=test
oplogSize=10
fork=false
journal=true
objcheck=false
autoresync=true
fastsync=true
nohints=true
root@mongu:/var/log/mongodb# mongo
MongoDB shell version: 2.0.0
connecting to: test
PRIMARY> use admin
switched to db admin
PRIMARY> rs.isMaster()
{
"setName" : "portal",
"ismaster" : true,
"secondary" : false,