This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| watch --difference=cummulative --interval=1 '(echo device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue; for file in /sys/block/*/stat; do echo -n $file; cat $file; done) | column -t' | |
| # OUTPUTS: | |
| #device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue | |
| #/sys/block/dm-0/stat 116962 0 2212746 314096 7705653 0 150218536 609670232 0 644428 610921004 | |
| #/sys/block/dm-1/stat 116479 0 2208882 313324 7686986 0 150218536 609676068 0 644616 611418072 | |
| #/sys/block/dm-2/stat 302 0 2416 780 0 0 0 0 0 148 780 | |
| #/sys/block/sda/stat 91181 26273 2217246 74876 7314854 388030 150261802 16954364 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // -*- coding:utf-8-unix; mode:c; -*- | |
| // | |
| // get the active window on X window system | |
| // | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <locale.h> | |
| #include <X11/Xlib.h> // `apt-get install libx11-dev` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * A simple libpng example program | |
| * http://zarb.org/~gc/html/libpng.html | |
| * | |
| * Modified by Yoshimasa Niwa to make it much simpler | |
| * and support all defined color_type. | |
| * | |
| * To build, use the next instruction on OS X. | |
| * $ brew install libpng | |
| * $ clang -lz -lpng16 libpng_test.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ヘッダファイルのインクルード */ | |
| /* 既定のヘッダファイル */ | |
| #include <stdio.h> /* 標準入出力 */ | |
| #include <stdlib.h> /* 標準ユーティリティ */ | |
| #include <string.h> /* 文字列処理 */ | |
| #include <png.h> /* libpng */ | |
| /* 独自のヘッダファイル */ | |
| #include "bitmap.h" /* ビットマップ */ | |
| /* main関数の定義 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Steps to configure this server to send mail via gmail relay | |
| 1. Download postfix and required packages | |
| sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules | |
| 2. Configure gmail as relay host : in /etc/postfix/main.cf | |
| relayhost = [smtp.gmail.com]:587 | |
| smtpd_sasl_auth_enable = yes | |
| smtp_sasl_auth_enable = yes | |
| smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd | |
| smtp_sasl_security_options = noanonymous |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # watch cgroup 'browsers' memory activity | |
| # | |
| # best served with ... | |
| # | |
| # https://gist.github.com/jakewarren/477ecd1149abe908cbd5cf7a7c9abaa3 | |
| self=$0 | |
| SUDO= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/python2 | |
| import gtk.gdk | |
| w = gtk.gdk.window_foreign_new( gtk.gdk.get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0] ) | |
| w.set_decorations( (w.get_decorations()+1)%2 ) # toggle between 0 and 1 | |
| gtk.gdk.window_process_all_updates() | |
| gtk.gdk.flush() | |
| # now bind this to super-r or something |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % ./a.out $WINDOWID | |
| Items: 22 | |
| Type: STRING | |
| WM_CLASS[0]: terminator | |
| WM_CLASS[1]: Terminator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Author: Raheman Vaiya | |
| * License: WTFPL (do you really need one?) | |
| * */ | |
| #include <stdio.h> | |
| #include <sys/time.h> | |
| #include <sys/types.h> | |
| #include <dirent.h> | |
| #include <string.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define _GNU_SOURCE | |
| #include <X11/Xlib.h> | |
| #include <X11/Xatom.h> | |
| #include <err.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int get_prop_card32(Display *d, Window w, Atom p) { | |
| Atom actual_type; |