Skip to content

Instantly share code, notes, and snippets.

View recall704's full-sized avatar
💭
I may be slow to respond.

recall704 recall704

💭
I may be slow to respond.
View GitHub Profile
@recall704
recall704 / iprule.sh
Created September 10, 2021 16:51 — forked from codehz/iprule.sh
nftables for redir proxy
ip rule add fwmark 0x233 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100

It seems that it does not matter what timezone is on the server as long as you have the time set right for the current timezone, know the timezone of the datetime columns that you store, and are aware of the issues with daylight savings time.

On the other hand if you have control of the timezones of the servers you work with then you can have everything set to UTC internally and never worry about timezones and DST.

Here are some notes I collected of how to work with timezones as a form of cheatsheet for myself and others which might influence what timezone the person will choose for his/her server and how he/she will store date and time.

MySQL Timezone Cheatsheet

@recall704
recall704 / clash
Created February 27, 2021 09:07 — forked from tony1016/clash
Openwrt init.d script for clash
#!/bin/sh /etc/rc.common
START=99
STOP=15
USE_PROCD=1
start_service(){
procd_open_instance clash
procd_set_param command /usr/bin/clash -d /etc/clash
@recall704
recall704 / pip.md
Created January 19, 2021 03:17 — forked from saurabhshri/pip.md
Install and use pip in a local directory without root/sudo access.

Install and use pip in a local directory without root/sudo access.

Why?

Many users when are given server access, do not have root (or sudo) privileges and can not simply do sudo apt-get install python-pip . Here's an easy way you can install and use pip without root (or sudo) access in a local directory. Note : This works without easy_install too.

How?

@recall704
recall704 / bash_curl_loop
Created November 13, 2020 09:24 — forked from ceme/bash_curl_loop
bash curl loop
while true; do sleep 1; curl http://www.google.com; echo -e '\n\n\n\n'$(date);done
@recall704
recall704 / human_time_duration.py
Created October 13, 2020 14:57 — forked from borgstrom/human_time_duration.py
Python: Convert seconds (duration) to human readable string
TIME_DURATION_UNITS = (
('week', 60*60*24*7),
('day', 60*60*24),
('hour', 60*60),
('min', 60),
('sec', 1)
)
def human_time_duration(seconds):
Serial Keys:
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD
GV7N2-DQZ00-4897Y-27ZNX-NV0TD
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0
GZ3N0-6CX0L-H80UP-FPM59-NKAD4
YY31H-6EYEJ-480VZ-VXXZC-QF2E0
ZG51K-25FE1-H81ZP-95XGT-WV2C0
VG30H-2AX11-H88FQ-CQXGZ-M6AY4
@recall704
recall704 / gzip.go
Created September 6, 2019 07:49 — forked from alex-ant/gzip.go
golang: gzip and gunzip
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"log"
)
@recall704
recall704 / ipset.service
Last active August 7, 2019 03:14 — forked from meanevo/ipset.service
IPSet settings persistence
#
# reference: http://namsep.blogspot.com/2015/12/yad-centos-7-iptables-ipset-and-fail2ban.html
# reference: http://pkgs.fedoraproject.org/cgit/ipset.git/tree/ipset.service
# file location: /etc/systemd/system/ipset.service
# cp ipset.service /etc/systemd/system
# systemctl enable ipset.service
# systemctl start ipset
# systemctl status ipset.service
#
# mkdir /etc/ipset
@recall704
recall704 / vpc-ip-address-to-container-amazon.sh
Created July 23, 2019 09:46 — forked from dbathgate/vpc-ip-address-to-container-amazon.sh
Assign VPC addresses to Docker containers associated as secondary IP addresses to an ENI in AWS
# Description: How to assign VPC addresses to Docker containers associated as secondary IP addresses to an ENI in AWS
# Operating System: Amazon Linux AMI 2016.09.1 (HVM)
# Prerequisites:
# - Assign N number of secondary IP addresses to network interface on Docker host
# - Each new container requires additional assignment of secondary IP addresses
# - Containers can be launched with --net=none to avoid adding a Docker networked NIC (docker run --net=none -d imageId)
# Credit to https://github.com/jpetazzo/pipework for steps on linking IP address
################# Setup Bridge of eth0 ######################
yum install bridge-utils -y