Skip to content

Instantly share code, notes, and snippets.

Avatar
🏴
revolution

Rojen Zaman rojenzaman

🏴
revolution
View GitHub Profile
View gist:7d7283f69c44c9cfc4365d2caf09a7cf
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" ],
@rojenzaman
rojenzaman / dynmotd
Last active Oct 19, 2021 — forked from cha55son/dynmotd
RHEL (Centos/Fedora) dynamic motd
View dynmotd
#!/bin/bash
# Installation:
#
# 1. nano /etc/ssh/sshd_config
# PrintMotd no
#
# 2. nano /etc/profile
# /usr/bin/dynmotd # Place at the bottom
#
View simple-https-server.py
# 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 / answerfile
Last active Jul 1, 2021 — forked from oofnikj/answerfile
Install Docker on Termux
View answerfile
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@rojenzaman
rojenzaman / httpstatus
Last active Jun 27, 2021 — forked from rsvp/httpstatus
httpstatus : bash script to get HTTP response code with optional status message (includes return true or false)
View httpstatus
#!/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() {
View gist:63597da2a52e8733d6e502672da3b082
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