Skip to content

Instantly share code, notes, and snippets.

View nabakdev's full-sized avatar
💭
need vacation

nabak nabakdev

💭
need vacation
View GitHub Profile
@nabakdev
nabakdev / torrent.md
Last active May 29, 2023 05:55
download via torrent using transmission-cli on linux

Install transmission-cli

Install Transmission if it's not already installed on your system

Arch Linux

sudo pacman -S transmission-cli

Download torrents

@nabakdev
nabakdev / boot.md
Last active June 25, 2023 12:59
Disable "Reboot into firmware interface" on boot with systemd-boot
sudo echo 'auto-firmware 0' >> /boot/loader/loader.conf
@nabakdev
nabakdev / reboot-openwrt.sh
Created March 30, 2023 08:20
Reboot openwrt based router with curl
#!/bin/bash
curl -X POST http://192.168.1.1/cgi-bin/luci/;stok=<SESSION_TOKEN>/admin/system/reboot \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
--data 'reboot=1&sessionid=<SESSION_TOKEN>'
@nabakdev
nabakdev / flash-os-images-to-usb-drives.md
Created March 8, 2023 07:05
Flash OS Images to USB Drives or SD CARD in linux
Image without compression
sudo dd if=openwrt_official_xxx.img of=/dev/sdX conv=fsync bs=1M status=progress
Image with gzip compression
zcat openwrt_official_xxx.img.gz | sudo dd of=/dev/sdX conv=fsync bs=1M status=progress
@nabakdev
nabakdev / postgrest-trigger.md
Created February 16, 2023 08:19
database triggers collections

Validate Name

create or replace function validate_name_length()
returns trigger as $$
begin
    if length(new.name) < 3 then
        raise exception 'Name must be at least 3 characters long';
    end if;
    return new;
end;

Update forker repository

Add the main repository

git remote add upstream https://github.com/{repo-owner}/{repo-name}.git

Fetch the main repository changes

@nabakdev
nabakdev / almalinux.md
Last active February 11, 2023 14:15
alma linux notes

Create user

useradd -m <name>

Add password to user

passwd <name>

Add user to wheel

usermod -aG wheel <name>

Install git

@nabakdev
nabakdev / Optimizations_Artix.md
Created January 10, 2023 06:01 — forked from themagicalmammal/Optimizations_Artix.md
Set of optimizations, I use on my Artix Setup
@nabakdev
nabakdev / hehe.js
Created January 7, 2023 09:51
Auto Unlike FB fanspage
setInterval(() => {
try {
let el = document.querySelector('[aria-label="Action options"]')
if (!!el) {
el.click()
setTimeout(() => document.querySelector('[role="menu"] > div > div > div > div > div > div > div').click(), 400)
}
} catch (err) {
console.log(err)
}