Skip to content

Instantly share code, notes, and snippets.

View rojenzaman's full-sized avatar
🏴
Why?

Rojen Zaman rojenzaman

🏴
Why?
  • localhost
  • Istanbul, Turkey
  • 00:56 (UTC +03:00)
View GitHub Profile
@rojenzaman
rojenzaman / update-cdn.sh
Created September 6, 2020 14:21
firewalld rules for cloudflare cdn IPs (Red Hat, CentOS, Fedora)
#!/bin/bash
curl https://www.cloudflare.com/ips-v4 > .ips-v4
curl https://www.cloudflare.com/ips-v6 > .ips-v6
firewall-cmd --new-zone=cloudflare --permanent
firewall-cmd --reload
for i in `<.ips-v4`; do firewall-cmd --zone=cloudflare --add-source=$i; done
for i in `<.ips-v6`; do firewall-cmd --zone=cloudflare --add-source=$i; done
@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 / temp.txt
Created January 18, 2024 21:44
Delete this
wget https://github.com/linuxhw/hw-probe/releases/download/1.6/hw-probe-1.6.5-189-x86_64.AppImage
chmod +x ./hw-probe-1.6.5-189-x86_64.AppImage
sudo -E ./hw-probe-1.6.5-189-x86_64.AppImage -all -upload
@rojenzaman
rojenzaman / systemctl
Created July 1, 2021 19:21
Emulate systemctl for runit installed termux
#!/bin/bash
# Emulate systemctl for runit installed termux.
function check_command() { [ -x "$(command -v ${1})" ] || { echo -e "\e[31m${1} not found, please install it.\e[0m" ; return 1 ; } }
if ! check_command sv; then
if ! check_command sv-enable; then
if ! check_command sv-disable; then
exit 1
fi
@rojenzaman
rojenzaman / jammy-static-ip.netplan.yaml
Created August 1, 2023 07:13
Ubuntu 22.04 (Server Edition) Static IP Configuration (Netplan)
network:
renderer: networkd
ethernets:
eth0:
addresses:
- 192.168.1.2/24
nameservers:
addresses: [192.168.1.1,1.1.1.1,1.0.0.1]
routes:
- to: default
@rojenzaman
rojenzaman / set_real_ip.sh
Last active July 20, 2023 23:10
Script to set real IP from cloudflare for NGINX
#!/bin/bash
ips_v4=$(curl -s https://www.cloudflare.com/ips-v4)
ips_v6=$(curl -s https://www.cloudflare.com/ips-v6)
while IFS= read -r line; do
echo "set_real_ip_from $line;"
done <<< "$ips_v4"
while IFS= read -r line; do
@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
#
@rojenzaman
rojenzaman / dynmotd.sh
Last active May 17, 2023 22:13
Rocky Linux dynamic motd
#!/bin/bash
# Installation:
#
# 1. nano /etc/ssh/sshd_config
# PrintMotd no
#
# 2. nano /etc/profile
# /usr/bin/dynmotd # Place at the bottom
#
@rojenzaman
rojenzaman / README.md
Created June 18, 2021 21:38
Spotify Adblock Fedora 34

Spotify Adblock Fedora 34

Install Spotify

First install the spotify package from negativo17's repository.

Enable negativo17 repo:

dnf config-manager --add-repo=https://negativo17.org/repos/fedora-spotify.repo
@rojenzaman
rojenzaman / stack.yml
Last active October 17, 2022 14:27
Amusewiki Play With Docker
# docker swarm-based
version: '3.8'
services:
app:
# texlive-base and texlive-full not supported due to size
image: rojen/amusewiki:package
environment:
#- PWD_HOST_FQDN=${PWD_HOST_FQDN}
- PWD_HOST_FQDN=labs.play-with-docker.com
- SESSION_ID=${SESSION_ID}