Skip to content

Instantly share code, notes, and snippets.

View bassu's full-sized avatar
💭
I may be slow to respond.

Abbas bassu

💭
I may be slow to respond.
View GitHub Profile
@bassu
bassu / Lenovo ThinkPad X230 Continous Review.md
Last active March 23, 2024 23:50
A Hacker's Ongoing Review of Lenovo ThinkPad X230

A Hacker's Ongoing Review for Lenovo ThinkPad X230

For Arch Linux Wiki: https://wiki.archlinux.org/index.php/ThinkPad_X230

Upate Aug 30, 2014 The machine died. Hopefully it enjoyed it short life!

Update: Aug 02, 2014 One early morning, the machine died after waking up from to cold unsuspend. It didn't start after then. Even couldn't get into POST. Power LED only lit for a second or two. Hard reset of 30 seconds also failed. Before declaring motherboard totally toasted, gave it a last try as suggested by our good ol' friend Pablo Stafforini. Took it a apart, unplugged battery and CMOS battery and let it sit for nearly 11 hours. It WORKED like a preposterous CPR supposedly to a machine! What a joke ;)

@bassu
bassu / .ramdisk.sh
Last active September 25, 2023 10:24
macOS: Chrome: RAM disk for write intensive usage
#!/bin/sh
set -eu
SIZE=3299328 # 1.5GiB i.e. 2048 = 1MB
CACHE_PREFIX="${HOME}/Library/Application Support/Google/Chrome/"
SYNC_PREFIX=${HOME}/RAM/Chrome/
rm -rf "${CACHE_PREFIX}"
mkdir -p "${CACHE_PREFIX}"
mkdir -p "${SYNC_PREFIX}"
@bassu
bassu / varnish-modules.md
Created January 21, 2020 06:36 — forked from fliphess/varnish-modules.md
Install varnish modules on ubuntu 16.04 xenial

Install varnish-modules on ubuntu 16.04 xenial

  1. Backup current configuration
mkdir -p /root/varnish && cp -rv /etc/varnish /root/varnish && cp /etc/default/varnish /root/varnish/varnish-default
  1. Install varnish key and repo from packagecloud:
@bassu
bassu / .bash-powerline.sh
Created August 1, 2019 21:16
Original bash powerline
#!/usr/bin/env bash
__powerline() {
# Unicode symbols
# readonly PS_SYMBOL_DARWIN=''
readonly PS_SYMBOL_LINUX='$'
readonly PS_SYMBOL_OTHER='%'
readonly GIT_BRANCH_SYMBOL='⑂ '
@bassu
bassu / gist:67733fc891afc2c8c8516f8a289791e0
Created August 20, 2018 12:09
pgsql locks monitoring
SELECT a.datname,
c.relname,
l.transactionid,
l.mode,
l.GRANTED,
a.usename,
a.query,
a.query_start,
age(now(), a.query_start) AS "age",
a.pid
@bassu
bassu / haproxy.cfg
Created April 2, 2016 18:03 — forked from ryzy/haproxy.cfg
HAProxy - essentials for HTTP/2
frontend https-in
mode tcp
bind *:443 ssl crt /etc/ssl/dummy.pem alpn h2,http/1.1
use_backend nodes-http2 if { ssl_fc_alpn -i h2 }
default_backend nodes-http
backend nodes-http
server node1 web.server:80 check
backend nodes-http2
# zfs upgrade
This system is currently running ZFS filesystem version 5.
All filesystems are formatted with the current version.
# zpool upgrade -v
This system supports ZFS pool feature flags.
The following features are supported:
@bassu
bassu / init.el
Created December 28, 2013 10:36 — forked from mig/init.el
;; emacs configuration
(push "/usr/local/bin" exec-path)
(add-to-list 'load-path "~/.emacs.d")
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq inhibit-startup-message t)
#!/usr/bin/env bash
set -e
if [ -z "$iso" ] ; then
printf -- ">>> You must invoke with iso=/path/to/winxp.iso $(basename $0)\n"
exit 1
fi
if [ -z "$url" ] ; then
@bassu
bassu / ZOL OOM Log for Behlendorf
Last active December 28, 2015 10:49
ZOL OOM Log for Behlendorf. The spl/slab and arcstat concatenation is at end of this file
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 3.4.61-9.el6.centos.alt.x86_64 (mockbuild@bn3.alt.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Wed Sep 11 15:34:17 UTC 2013
Command line: ro root=UUID=94bf0589-cc13-4e45-a8e7-3f7e3b383e23 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_MD_UUID=57d163f2:904115e4:f08b19c3:347d9c81 SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_DM rd_NO_LVM rd_MD_UUID=89ca9bed:6f8d56ea:df10f673:9f7edfb7 rhgb quiet pcie_aspm=off
Freeing 9a-100 pfn range: 102 pages freed
1-1 mapping on 9a->100
Freeing bf780-100000 pfn range: 264320 pages freed
1-1 mapping on bf780->100000
Released 264422 pages of unused memory
Set 264422 page(s) to 1-1 mapping