Skip to content

Instantly share code, notes, and snippets.

View msudgh's full-sized avatar

Masoud Ghorbani msudgh

View GitHub Profile
arastu / current_track.applescript
Last active November 27, 2020 19:52
update twitter bio and add current playing song from Spotify to it
on escape_quotes(string_to_escape)
set AppleScript's text item delimiters to the "\""
set the item_list to every text item of string_to_escape
set AppleScript's text item delimiters to the "\\\""
set string_to_escape to the item_list as string
set AppleScript's text item delimiters to ""
return string_to_escape
end escape_quotes
tell application "Spotify"
bermi /
Created March 9, 2020 18:35
Exposes key value pairs on a yaml file as environment variables
#!/usr/bin/env bash
# Exports a flat yaml key:value pairs as environment variables
# To source a yaml file as environment variables run
# . yaml-source env.yml
eval $(
cat $1 |
rezkam /
Created May 13, 2019 23:14
Remove likes (favorite) from your tweets using twitter API (Working with Python 3.5+)
Remove likes (favorite) from your tweets using twitter API
you need to install twitter-client for python to use this code:
pip install python-twitter ( more info
to use this you need to generate authntication tokens for your account
find more info on (
import asyncio
bradtraversy /
Last active July 11, 2024 00:07
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
Ryanb58 /
Last active June 25, 2024 19:59
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
v3.7.0-243-gf26e75a186 []
v3.7.0-229-g087f28e29d []
ganapativs / iTerm2 + oh-my-zsh + Pure theme + zsh plugins
Last active June 23, 2024 10:41
iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup
numb95 /
Last active February 28, 2024 03:05
Route all internet traffic through Tor

Do not use in production Server or if you don't know what iptables do

Add this to torrc ( located on /etc/tor/torrc):


AutomapHostsOnResolve 1

TransPort 9051 
narbehaj /
Last active May 28, 2018 23:54
Finds duplicate files under the directory
import hashlib
import os
m_list = []
for i, d , e in os.walk('/home/test/'):
for file in e:
if file.endswith('mkv'):
with open('{}/{}'.format(i, file), 'rb') as file_read:
for chunk in iter(lambda:, b""):
william8th / .tmux.conf
Last active July 4, 2024 11:36
Tmux open new pane in same directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# using:
# for set proxy:
# $ setproxy 8118
# for unset:
# $ unsetproxy
function setproxy() {
export {http,https,ftp,HTTP,HTTPS}_proxy=http://$1:$2
export no_proxy="localhost,,master.cafecluster"
echo "Proxy variable(http,https,ftp) set to $1:$2"