Skip to content

Instantly share code, notes, and snippets.

View vavrecan's full-sized avatar

Marek Vavrecan vavrecan

View GitHub Profile
@vavrecan
vavrecan / Linux Screen Capture
Last active October 20, 2018 22:51
capture
$ best Linux screen capture settings of the day
ffmpeg -thread_queue_size 128 -f alsa -i default -f x11grab -isync -r 30 -ac 2 -s 1920×1080 -i :0.0+0,0 -vcodec libx264 -preset veryfast -pix_fmt yuv420p -acodec libmp3lame -ar 44100 -ab 192k -threads 4 -y Desktop.mp4
# vokoscreen app to capture
# Update: w/ VAAPI e.g. for Intel’s QuickSync:
ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -thread_queue_size 64 -f alsa -i default -thread_queue_size 64 -f x11grab -isync -r 30 -ac 1 -s 1920×1080 -i :0.0+0,0 -vf ‘format=nv12,hwupload’ -threads 8 -aspect 16:9 -b:v 12500k -vcodec h264_vaapi -af “lowpass=f=7000″ -acodec aac -ab 192k -threads 8 ~/Desktop/`date ‘+%Y%m%d-%H%M%S’.mp4`
# https://rene.rebe.de/2017-06-23/best-video-screen-capture-settings-of-the-day/
# dump database and files
mysqldump -u user database > ~/database.sql
tar -zcvf ~/backup.tar.gz database.sql /var/www/sitefolder
rm ~/database.sql
@vavrecan
vavrecan / fast-webserver.sh
Last active October 19, 2024 19:21
Drop NGINX+PHP+MariaDB+LetsEncrypt
#!/bin/bash
if [ "$#" -gt 0 ];
then
echo "using $1 as domain;"
else
echo -e "usage: $0 [site domain] [database name:database password]\ne.g. $0 domain.org database:password"
exit
fi
@vavrecan
vavrecan / proxify.sh
Created September 30, 2014 16:46
Redsocks Router
#!/bin/bash
# This script will forward internet connection over redsocks proxy
# - Install redsocks and make it listen to any IP
# - Setup Wifi AP or ETH connection and DHCP server
# - Connect to ssh with -D 1080 parameter or start tor on port 1080
# - Run the script
INTERNET_INTERFACE=wlan0
SUBNET_INTERFACE=wlan1
@vavrecan
vavrecan / zip_pack_directory.php
Created January 30, 2014 12:49
Simple script to pack everything in specific directory
<?php
set_time_limit(500);
function Zip($source, $destination)
{
if (!extension_loaded('zip') || !file_exists($source)) {
return false;
}
@vavrecan
vavrecan / rename-apk-namespace
Last active March 9, 2025 09:01
Script that allows renaming namespace of Android APK so you can install same application multiple times
#!/bin/bash
# author Marek Vavrecan (vavrecan@gmail.com)
# show usage
[ $# -eq 0 ] && { echo "Usage: $0 [apk path] [source namespace] [target namespace]"; exit 1; }
APK_PATH="$1"
NAMESPACE_FROM="$2"
NAMESPACE_TO="$3"