Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
revolution

Rojen Zaman rojenzaman

🎯
revolution
View GitHub Profile
View stop-generating-wp.sh
#!/bin/bash
#https://github.com/docker-library/wordpress/blob/8215003254de4bf0a8ddd717c3c393e778b872ce/docker-entrypoint.sh#L48
PREFIX="$2"
[[ -z "$PREFIX" ]] && PREFIX="./public_html"
is_empty() {
test -e "$1/"* 2>/dev/null
case $? in
1) return 0 ;;
@rojenzaman
rojenzaman / run.sh
Created Apr 30, 2021
Wayback Machine Downloader - Podman
View run.sh
podman run --rm -it -v ./website:/websites:Z hartator/wayback-machine-downloader http://example.com/
@rojenzaman
rojenzaman / example-sed.sh
Created Apr 14, 2021
Replace specified character between two specified strings.
View example-sed.sh
# s@\(START.*\)FOO\(.*END\)@\1BAR\2@
$ echo "START FOO END FOO" | sed -e :1 -e 's@\(START.*\)FOO\(.*END\)@\1BAR\2@;t1;'
START BAR END FOO
@rojenzaman
rojenzaman / answerfile
Created Mar 31, 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 / set_real_ip.sh
Created Mar 21, 2021
Script to set real IP from cloudflare for NGINX
View set_real_ip.sh
#!/bin/bash
curl -s https://www.cloudflare.com/ips-v4 > .ips-v4
curl -s https://www.cloudflare.com/ips-v6 > .ips-v6
for i in `<.ips-v4`; do echo "set_real_ip_from $i;"; done
for i in `<.ips-v6`; do echo "set_real_ip_from $i;"; done
echo "real_ip_header CF-Connecting-IP;"
View README.md

red hat icon

created with GNU GIMP

@rojenzaman
rojenzaman / list.sh
Created Feb 20, 2021
DNF List All Installed Packages
View list.sh
rpm -qa --qf '%{INSTALLTIME} (%{INSTALLTIME:date}): %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -n
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 / rss-pubdate.sh
Created Jan 19, 2021
Create RSS pubDate with BASH
View rss-pubdate.sh
#format: Tue, 19 Jan 2021 19:07:07 +0300
TZ=`date +"%z"`
TIME=`date +"%H:%M:%S"`
WEEKDAY=`date +"%a"`
DATE=`date +"%d"`
MONTH=`date +"%b"`
YEAR=`date +"%Y"`
FORMATED_DATE_TIME="$WEEKDAY, $DATE $MONTH $YEAR $TIME $TZ"
echo "Formated time: $FORMATED_DATE_TIME"
@rojenzaman
rojenzaman / dynmotd
Created Jan 9, 2021
Raspberry Pi OS 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
#