Skip to content

Instantly share code, notes, and snippets.

View snappytux's full-sized avatar
🐔
Friends Not Food

iChamp snappytux

🐔
Friends Not Food
View GitHub Profile
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
@snappytux
snappytux / text
Created December 27, 2017 04:54
Produce high CPU load on a Linux server?
for i in 1 2 3 4; do while : ; do : ; done & done
@snappytux
snappytux / gist:b2a9dff3da331d6317f3d9188b3caa65
Created December 25, 2017 07:40
Regex for fb and google on Mikrotik
^(.*)(youtube|facebook)(.*)$
@snappytux
snappytux / rmFiles.sh
Created December 21, 2017 03:24
rm all files except some
#!/bin/bash
find . -type f -not -name '*ignore' -not -name 'bk.sh' -not -name 'rmFile.sh' | xargs rm
@snappytux
snappytux / setup.sh
Last active March 25, 2023 03:46
First install docker in ubuntu 22.04
#!/bin/bash
apt update && apt upgrade -y
apt install -y ntp
timedatectl set-timezone Asia/Bangkok
timedatectl
apt-get remove docker docker-engine docker.io containerd runc
apt-get update
apt-get install -y \
apt install -y ntp
timedatectl set-timezone Asia/Bangkok
timedatectl
@snappytux
snappytux / rmOlder7days.sh
Created August 24, 2017 04:17
Remove file older 7 days
#!/bin/sh
find /root/* -mtime +7 -exec rm {} \;
@snappytux
snappytux / get-token
Created April 23, 2017 13:59
docker swarm get token
docker swarm join-token --rotate manager
@snappytux
snappytux / 0_reuse_code.js
Created April 22, 2017 13:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console