put these line on your .bashrc:
...
alias dedup='history -n; history -w; history -c; history -r;'
# https://superuser.com/a/664061/1867794
# Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".| import json | |
| import collections | |
| with open('./test.jsonl', 'r') as json_file: | |
| json_list = list(json_file) | |
| for json_str in json_list: | |
| result = json.loads(json_str, object_pairs_hook=collections.OrderedDict) | |
| result = json.dumps(result, indent=4) | |
| print(f"\n{result}") |
| bind-interfaces | |
| no-resolv | |
| dhcp-range=192.168.33.2,192.168.33.20,12h | |
| dhcp-option=3,192.168.33.1 # Gateway (gw) | |
| dhcp-option=6,192.168.33.1 # DNS | |
| log-queries | |
| log-dhcp |
| #!/usr/bin/sh | |
| for iface in $(ls /sys/class/net/); do | |
| echo "Interface: $iface"; | |
| mode=$(iw $iface info 2>/dev/null) | |
| if [[ $? -eq 0 ]]; then | |
| mode=$(echo "$mode" | grep type | awk '{print $2}') | |
| echo "Mode: $mode" | |
| fi | |
| ethtool -i $iface 2>/dev/null | grep -E 'driver|version'; |
Live Boot arch linux:
qemu-system-x86_64 \
-drive format=raw,file=./archlinux-2024.04.01-x86_64.iso,index=0,media=disk \
-enable-kvm -machine pc -cpu host -m 1G -nographicSince the above command using -nographic, so we don't start VNC server, thus don't forget to add console=ttyS0 to kernel parameter, press on the bootloader to modify kernel parameter
not related link:
The idea came from Nir Lichtman video with the title: 'Making Simple Linux Distro from Scratch'
this gist just re-document it in the form of text
| const { spawn } = require('node:child_process') | |
| const readline = require('node:readline'); | |
| const { stdin: input, stdout: output } = require('node:process'); | |
| const rl = readline.createInterface({ input, output }); | |
| const shell = spawn('sh') | |
| shell.stdout.on('data', (data) => { | |
| process.stdout.write(data.toString()) |
| const { get } = require("node:https") | |
| require('dotenv').config(); | |
| function fetch(url) { | |
| return new Promise((resolve, reject) => { | |
| get(url, (res) => { | |
| let buff = Buffer.alloc(0); | |
| res.on("data", chunk => buff = Buffer.concat([buff, Buffer.from(chunk)])) | |
| res.on("error", reject) | |
| res.on("end", () => resolve(buff)) |
| const { get } = require("node:https"); | |
| (async () => { | |
| const stickerName = ['Elaina_san', 'bagasgoyang'] | |
| const token = "bot7003873933:AAFKl0LwWViMJIA34-qjbTh7nZwcNQr2hFs" | |
| const domain = "https://api.telegram.org" | |
| const file_baseurl = `${domain}/file/${token}` | |
| const api_baseurl = `${domain}/${token}` | |
| stickerName.forEach(async (name) => { |