Skip to content

Instantly share code, notes, and snippets.

View khurshid-alam's full-sized avatar

Khurshid Alam khurshid-alam

View GitHub Profile
USERNAME [a-zA-Z0-9._-]+
USER %{USERNAME}
INT (?:[+-]?(?:[0-9]+))
BASE10NUM (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))
NUMBER (?:%{BASE10NUM})
BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+))
BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b
POSINT \b(?:[1-9][0-9]*)\b
NONNEGINT \b(?:[0-9]+)\b
@khurshid-alam
khurshid-alam / sysctl.conf
Created October 19, 2020 17:39 — forked from yegorg/sysctl.conf
ubuntu sysctl performance tuning
# Kernel sysctl configuration file for Linux
#
# Version 1.12 - 2015-09-30
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@khurshid-alam
khurshid-alam / sysctl.conf
Created October 19, 2020 17:39 — forked from yegorg/sysctl.conf
ubuntu sysctl performance tuning
# Kernel sysctl configuration file for Linux
#
# Version 1.12 - 2015-09-30
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@khurshid-alam
khurshid-alam / trsm
Last active March 13, 2017 11:36
Transmission-Shutdown-script
#!/bin/bash
#Transmission-Shutdown-Script
========
#This is the transmission shutdown script I wrote for a [askubuntu question](http://askubuntu.com/questions/202537/transmission-#shutdown-script-for-multiple-torrents) with the help of transmission RPC interface.
#**What it Does?**
FOO=' test test test '
FOO_NO_EXTERNAL_SPACE="$(echo -e "${FOO}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
echo -e "FOO_NO_EXTERNAL_SPACE='${FOO_NO_EXTERNAL_SPACE}'"
# > FOO_NO_EXTERNAL_SPACE='test test test'
echo -e "length(FOO_NO_EXTERNAL_SPACE)==$(echo -ne "${FOO_NO_EXTERNAL_SPACE}" | wc -m)"
# > length(FOO_NO_EXTERNAL_SPACE)==14
@khurshid-alam
khurshid-alam / reload-iwl3945.sh
Created March 1, 2016 05:38
Reload iwl3945 wifi driver (Ubuntu)
#!/bin/bash
sudo modprobe -r iwl3945
sudo modprobe iwl3945
@khurshid-alam
khurshid-alam / 0_reuse_code.js
Created December 26, 2013 12:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@khurshid-alam
khurshid-alam / browser-notepad
Last active December 19, 2015 19:58 — forked from ImBobby/gist:5996847
Browser-Notepad
# paste this in url
# https://coderwall.com/p/lhsrcq
# Plain-paper style
data:text/html, <html contenteditable>
@khurshid-alam
khurshid-alam / Save Evolution-Contacts as separate vcf
Last active December 19, 2015 17:49
Save Evolution-Contacts as separate vcf with file-names as contact-names
#!/bin/bash
# require syncevolution
# on ubuntu run following commands
# sudo add-apt-repository deb http://downloads.syncevolution.org/apt stable main
# sudo apt-get update
# sudo apt-get install syncevolution-evolution
# askubuntu question: http://askubuntu.com/questions/265083/how-to-export-save-evolution-contacts-as-seperate-vcf-files
@khurshid-alam
khurshid-alam / notify-osd-ssh
Last active December 18, 2015 02:08
Send Notify-OSD notification through ssh.
#!/bin/bash
# send notify-osd notification through ssh