Skip to content

Instantly share code, notes, and snippets.

View rojenzaman's full-sized avatar
🏴
Why?

Rojen Zaman rojenzaman

🏴
Why?
  • localhost
  • Istanbul, Turkey
  • 02:22 (UTC +03:00)
View GitHub Profile
@rojenzaman
rojenzaman / multiple-push-urls.md
Created February 4, 2024 15:37 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@rojenzaman
rojenzaman / myweechat.md
Created April 22, 2022 09:46 — forked from pascalpoitras/config.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

The squares in the chanmon buffer at the top of weechat in the gif above are there only to hide the nicknames and the messages in the gif to respect users privacies

You need at least WeeChat 3.5-dev

Enable mouse

/mouse enable
@rojenzaman
rojenzaman / gist:63597da2a52e8733d6e502672da3b082
Created June 13, 2021 21:47 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@rojenzaman
rojenzaman / httpstatus
Last active June 27, 2021 16:38 — forked from rsvp/httpstatus
httpstatus : bash script to get HTTP response code with optional status message (includes return true or false)
#!/bin/bash
URL="${1}"
UserAgent="[HTTPSTATUS]:[https://git.io/JcTUF]"
if [ "$#" -lt 1 ]; then
echo "Usage: ./`basename $0` URL"
exit 1
fi
function unknown_status() {
@rojenzaman
rojenzaman / answerfile
Last active July 1, 2021 22:29 — forked from oofnikj/answerfile
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@rojenzaman
rojenzaman / dynmotd
Last active June 9, 2023 21:17 — forked from cha55son/dynmotd
RHEL (Centos/Fedora) dynamic motd
#!/bin/bash
# Installation:
#
# 1. nano /etc/ssh/sshd_config
# PrintMotd no
#
# 2. nano /etc/profile
# /usr/bin/dynmotd # Place at the bottom
#
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],