Skip to content

Instantly share code, notes, and snippets.

View ohmydevops's full-sized avatar

Amirhossein Baghaie ohmydevops

View GitHub Profile
alirezaarzehgar /
Last active January 10, 2024 20:49
Create Super Minimal Linux Live Distro!
#!/usr/bin/env bash
[ -d /tmp/root ] && rm /tmp/root/boot
# Install Busybox
mkdir -p /tmp/root/{bin,dev,etc,lib,mnt,proc,sbin,sys,tmp,var,boot/grub}
cd /tmp/root || exit
wget ${URL} --no-clobber -O bin/busybox
chmod +x bin/busybox
carolynvs / .gitconfig
Last active October 19, 2022 14:44
git wip - Show what branches you have been working on lately
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
gpchelkin /
Last active May 3, 2024 06:38
How to Setup shadowsocks-rust Server with xray-plugin (or v2ray-plugin) on Any Linux Host
#!/usr/bin/env bash
export SSVERSION=v1.18.2
export SSPORT=143
export SSARCHIVE="shadowsocks-${SSVERSION}.x86_64-unknown-linux-gnu.tar.xz"
#export SSARCHIVE="shadowsocks-${SSVERSION}.aarch64-unknown-linux-gnu.tar.xz"
export PREFIX=/usr/local/bin
jtyr /
Last active December 4, 2022 11:43
Capture keyboard and mouse events on Linux

Instructions how to capture keyboard and mouse events and turn them into human readable output.

  1. Run evtest without any argments and see which event device you need to use.
  2. Run the following command for the keyboard events:
evtest /dev/input/event5 | grep --line-buffered 'EV_KEY' | sed -r -e 's/.*\(KEY_/Keyboard: /' -e 's/\), value 0/ - UP/' -e 's/\), value 1/ - DOWN/' -e 's/\), value 2/ - HOLD/'

Example of the output:

Keyboard: Z - DOWN
ruanbekker /
Last active May 27, 2024 11:34
Docker Container Logging using Promtail
kislayverma /
Created December 26, 2019 07:11
A copy (for posterity) of Steve Yegge's internal memo in Google about what platforms are and how Amazon learnt to build them

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engineers pretty much do everything,

AmirHo3ein13 / Elasticsearch Cheat
Last active March 12, 2021 03:42
simple cheat sheet for Elasticsearch
aymericbeaumet /
Last active May 27, 2024 18:07
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to:{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
jessarcher /
Last active March 10, 2024 17:25
Using my Canon 70D DSLR camera as a web cam on Linux

You'll need:

  1. Video 4 Linux loopback device kernel module (v4l2loopback) - Source: (You might find builds in your distro's repos - I'm using Fedora so had to build it myself using
  2. gPhoto2 - this is what allows you to access your cameras live feed over USB - this was available in Fedora's repos.
  3. GStreamer or ffmpeg - this is what lets you stream the output from gPhoto2 into the loopback device.

It's been a little while since I set it all up so I can't remember all of the installation details, which will probably be different for your distro anyway unless you're using Fedora. Apologies if I have forgotten something as wel.

Running the stream

fbn4sc / command.txt
Created January 29, 2018 01:35
Delete all branches except master and develop.
git branch | grep -v "master\|develop" | xargs git branch -D