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 / permission.sh
Created March 30, 2021 04:43
Laravel file permissions
$LARAVEL_PATH=/var/www/example
cd $LARAVEL_PATH
sudo chown -R $USER:www-data $LARAVEL_PATH
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
@nabakdev
nabakdev / ffmpeg.md
Last active July 25, 2021 12:45
ffmpeg notes

Video stabilization using VidStab

Analyze video to create 'transforms.trf'

ffmpeg -i input.mp4 -vf vidstabdetect -f null -

Create stabilized video

ffmpeg -i input.mp4 -vf vidstabtransform=smoothing=5:input="transforms.trf" out-stabilized.mp4'

Compress video

ffmpeg -i input.mp4 -c:v libx264 -crf 18 -preset veryslow -c:a copy out.mp4

@nabakdev
nabakdev / notes.txt
Created November 14, 2021 09:07
fix linux root dir
restorecon <dir-path>
# ex: restorecon /var
@nabakdev
nabakdev / compression.md
Last active November 15, 2021 14:03
Compression CLI

xz

xz -d <file-path>

7z

7z x -o

@nabakdev
nabakdev / linux-optimization.sh
Last active November 17, 2021 07:38
linux optimization
# add kernel parameter
# `quiet splash loglevel=0 rd.systemd.show_status=false nowatchdog`
# prefer ZRAM Instead of Disk-Swap
# more about zram: https://wiki.archlinux.org/title/Improving_performance#zram_or_zswap
# custom kernel
# xanmod (aur): https://aur.archlinux.org/packages/linux-xanmod/
# then update bootloader:
# - arch linux: /boot/loader/entries/* (systemd-boot)
@nabakdev
nabakdev / initial-setup.sh
Created November 17, 2021 08:01
Linux initial setup
# enable ntp
timedatectl set-ntp true
# set timezone
# ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
hwclock --systohc
# Localization
sed -i '/en_US.UTF-8 UTF-8/s/^#//' /etc/locale.gen
https://block.energized.pro/assets/sources/filter/adblock-id.txt
https://dbl.oisd.nl/
https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt
https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts
@nabakdev
nabakdev / enable-120FPS-mobile-legends.sh
Last active November 5, 2022 12:49
Enable 120FPS Mobile Legends [ROOT Only]
#!/bin/bash
# USAGE: su -c "bash <(curl -sL https://gist.githubusercontent.com/nabakdev/56b16901980c2226f1920f015a176f23/raw/enable-120FPS-mobile-legends.sh)"
CFILE="/data/data/com.mobile.legends/shared_prefs/com.mobile.legends.v2.playerprefs.xml"
sed -i 's|name="HighFpsMode" value="60">|name="HighFpsMode" value="120"|g' $CFILE
sed -i 's|name="HighFpsModeSee" value="2"|name="HighFpsModeSee" value="4"|g' $CFILE
@nabakdev
nabakdev / getView.sh
Created November 29, 2022 10:42
Get youtube view count [BASH][CURL]
#!/bin/bash
curl "https://m.youtube.com/watch?v=${VID_ID}" \
-s \
-H 'authority: m.youtube.com' \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'cache-control: max-age=0' \
-H 'dnt: 1' \
-H 'sec-fetch-dest: document' \
@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)
}