Skip to content

Instantly share code, notes, and snippets.

@abdullahdhiab
abdullahdhiab / mount_lvm_usb.sh
Created March 24, 2023 23:19 — forked from gmolveau/mount_lvm_usb.sh
linux/lvm mount external USB LVM partition
sudo vgscan
# note vg name
sudo vgchange -ay <VG-NAME>
sudo lvdisplay
# note `LV Path`
sudo mkdir -p /media/usb/lvm_usb
sudo mount <LV-PATH> /media/usb/lvm_usb
# to automount this partition
sudo nano /etc/fstab
@abdullahdhiab
abdullahdhiab / style.css
Created November 7, 2019 21:13 — forked from malja/style.css
PHP class for creating pretty HTML table from PHP array
/************************************************************************\
|
| CSS Theme
| =========
|
| This is a default CSS theme for tabletizer class.
|
\************************************************************************/
table.tabletizer {
@abdullahdhiab
abdullahdhiab / .Xmodmap
Created April 13, 2019 21:03 — forked from k2nr/.Xmodmap
NixOS configuration for MacBookPro retina 15 early 2012
keycode 97 = grave asciitilde
keycode 132 = grave asciitilde
@abdullahdhiab
abdullahdhiab / configuration.nix
Created April 13, 2019 15:52
NixOS + XMonad to work on a mid-2012 MBP 13"
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot.initrd.kernelModules = [ "fbcon" "hid_apple" ];
boot.initrd.luks.devices = [ { name = "system"; device = "/dev/sda4"; preLVM = true; } ];
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
#!/usr/bin/env python3
'''
A script to recursively compare two directories (including file size and file hash changes)
Usage: python3 compare_dirs.py DIR1 DIR2
'''
import os, sys, hashlib
COMPARE_FILES = True # should file sizes be compared if their names are the same?
@abdullahdhiab
abdullahdhiab / skylake-tuning-linux.md
Created March 4, 2019 21:49 — forked from Brainiarc7/skylake-tuning-linux.md
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@abdullahdhiab
abdullahdhiab / 70-synaptics.conf
Created February 28, 2019 23:48 — forked from roghnin/70-synaptics.conf
/etc/X11/xorg.conf.d/70-synaptics.conf
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# Additional options may be added in the form of
# Option "OptionName" "value"
#
Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
# Maintainer: Alex Tharp <toastercup@gmail.com>
# Original Maintainer: Muratcan Sisek <mail@muratcansimsek.com.tr>
pkgname=hiri
pkgver=1.4.0.1
pkgrel=1
pkgdesc="A cross-platform, Exchange-ready email client aiming to replace Outlook"
arch=('x86_64')
url="https://www.hiri.com/"
license=('custom')
provides=('hiri')