Skip to content

Instantly share code, notes, and snippets.

View zubair1024's full-sized avatar
🎯
Focusing

Zubair Ahmed zubair1024

🎯
Focusing
View GitHub Profile
@zubair1024
zubair1024 / fault_reducer_script.js
Created July 4, 2021 22:50
Figures out overlapping fault durations in a given timeline
//TODO make sure all the Faults fall inside the window per ascending start and end time
const fault1 = { name: "fault1", timing: [0, 10] };
const fault2 = { name: "fault2", timing: [5, 20] };
const fault3 = { name: "fault3", timing: [10, 30] };
const fault4 = { name: "fault4", timing: [70, 80] };
let allFaults = [fault2, fault1, fault3, fault4];
allFaults.sort((a, b) => {
@zubair1024
zubair1024 / media_query_cheatsheet.css
Created April 10, 2021 19:56
Responsive Media Query Cheatsheet
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@zubair1024
zubair1024 / .gitignore
Created January 5, 2021 21:55
one_gitignore_to_rule_them_all
#######################################
# Custom #
#######################################
.vscode
#######################################
# Operating Systems #
#######################################
db.livepolicies.aggregate()
.match({
masterGroupID1Count: {
$exists: true
}
})
.project({
'DateString': {
$dateToString: {
format:'%Y-%m-%d',
cat ~/.ssh/id_rsa.pub | \
  ssh pi@192.168.1.25 \
  "sudo mkdir /root/.ssh; sudo tee -a /root/.ssh/authorized_keys"

Run the docker image

docker run --rm -it progrium/stress -m 20  --timeout 1440s

Find all zombie processes

ps aux | grep 'Z'

Kill the process (replace pid with the process ID from the above list )

kill -s SIGCHLD pid

Install dependencies for the build issues

sudo apt-get install -y build-essential libpng-dev

Installation 2.0

Setup User

  1. Add user
adduser username

Caching your GitHub password in Git

$ git config --global credential.helper cache

  • Set the cache to timeout after 1 hour (setting is in seconds)

$ git config --global credential.helper 'cache --timeout=3600'