Skip to content

Instantly share code, notes, and snippets.

Avatar

Mo Ismailzai moismailzai

View GitHub Profile
@moismailzai
moismailzai / 0x5f3759df-quake-iii-arena-s-fast-inverse-square-root-function-explained.markdown
Last active Jul 30, 2016
0x5f3759df - Quake III Arena's Fast Inverse Square Root Function Explained
@moismailzai
moismailzai / package.json
Last active Feb 14, 2017
Prototype for transporting HTML via JSON
View package.json
{
"html": {
"body": {
"_attributes": {
"_class": [
"container",
"flex"
]
},
"_children": {
@moismailzai
moismailzai / sphp.sh
Last active Apr 5, 2017 — forked from w00fz/sphp.sh
PHP switcher
View sphp.sh
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@moismailzai
moismailzai / autoexec.cfg
Last active May 21, 2017
CS:GO autoexec.cfg
View autoexec.cfg
// Net Stuff (affects connection to the server: increases bandwidth, reduces interpolation, choke, and latency)
rate "786432"
cl_cmdrate "128"
cl_forcepreload "1"
cl_lagcompensation "1"
cl_interp "0"
cl_interp_ratio "1"
cl_updaterate "128"
mm_dedicated_search_maxping "35"
@moismailzai
moismailzai / vagrant-clean.sh
Last active Sep 3, 2018 — forked from jdowning/vagrant-clean.sh
Script to clean up Ubuntu Vagrant box before packaging
View vagrant-clean.sh
#!/bin/bash
# This script zeroes out any space not needed for packaging a new Ubuntu Vagrant base box.
# Run the following command in a root shell:
#
# bash <(curl -s https://gist.githubusercontent.com/moismailzai/0864e90d55d508ec8f5aa1ccd68887c6/raw/fdfd7b28bd00623311689a50754307b06e2e5922/vagrant-clean.sh)
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
View gist:9619349ec507ec2abb8049c4fd38cb20
#!/bin/bash -eux
# Add vagrant user to sudoers
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
# UseDNS no to `sshd_config`.
sed /UseDNS/d /etc/ssh/sshd_config > /tmp/sshd_config
echo "UseDNS no" >> /tmp/sshd_config
mv /tmp/sshd_config /etc/ssh/sshd_config
@moismailzai
moismailzai / .travis.yml
Created Nov 6, 2018 — forked from jonfriesen/.travis.yml
Example .travis.yml for Golang with CodeCov.io integration
View .travis.yml
language: go
# Only the last two Go releases are supported by the Go team with security
# updates. Any versions older than that should be considered deprecated.
# Don't bother testing with them. tip builds your code with the latest
# development version of Go. This can warn you that your code will break
# in the next version of Go. Don't worry! Later we declare that test runs
# are allowed to fail on Go tip.
go:
- 1.9
View varnish-purge-cache.sh
# Purge all Varnish cache
varnishadm "ban req.url ~ /"
View gist:cb3218150d49c57cfcac472a76eaaf39
KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
You can’t perform that action at this time.