Skip to content

Instantly share code, notes, and snippets.

View xardit's full-sized avatar
🍀

Ardit Hyka xardit

🍀
View GitHub Profile
for i in *.mkv ; do
mkvmerge -o "fixed_$i" --nosubs --no-chapters "$i"
mkvpropedit "fixed_$i" --edit info --set title= --edit track:1 --set name= --edit track:2 --set name=
done
alias ll='ls -Fls'
alias la='ls -Flas'
alias psa='ps -A -r -ww'
alias c='clear'
# MacPorts Installer addition on 2014-08-19_at_22:36:10: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
http://www.howtoforge.com/apache_php_mysql_on_centos_7_lamp
rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
yum -y update
yum -y install mariadb-server mariadb httpd php
systemctl start mariadb.service
systemctl start httpd.service
systemctl enable mariadb.service
##### tcp port forward
~#configure terminal
~$ip nat inside source static tcp 192.168.1.69 22 FastEthernet0/1 22
(press to get out of config) CTRL+Z
~#write memory
#####
##### show IP and INTERFACE
~#show ip interface brief
~#sh ip int br
function bin2all() {
if [[ $1 ]]; then
echo "Binary $1 = Octal $(bin2oct $1)"
echo "Binary $1 = Decimal $(bin2dec $1)"
echo "Binary $1 = Hexadecimal $(bin2hex $1)"
echo "Binary $1 = Base32 $(bin2base32 $1)"
echo "Binary $1 = Base64 $(bin2base64 $1)"
echo "Binary $1 = ASCII $(bin2ascii $1)"
else
echo "Convert Binary numbers to all representations"
######## BACKUP.SH @ MAIN SERVER ########
#!/bin/sh
maxretry=100
retry=0
nfscheck(){
m=`mount | grep /home/backups | wc -l`
if [ $m -eq 0 ]; then
ping -c 2 192.168.1.69 > /dev/null
### duck.sh ###
#!/bin/sh
echo url="https://www.duckdns.org/update?domains=$1&token=$2&ip=$3" | curl -k -o ~/.logs/duck.log -K -
####
#add to cron
*/5 * * * * duck.sh my_subdomain_name my_key >/dev/null 2>&1
### create encrypted USB
# reset nad create partition to the usb drive
fdisk /dev/sdb
##type 'o' to reset the table > 'n'ew > 'p'rimary partition > type 'w' to save
# format partition with luks & encrypt
cryptsetup luksFormat /dev/sdb1
# mount & format fs
# ImageMagicK_automation_linux_and_windows
FOR /F %i IN ('dir /b *') DO ( @ren %~ni %RANDOM% )
convert 1.jpg -strip -resize "1083x722^" -gravity Center -crop "1083x722+0+0" 1.jpg
#RENAME FIRST
#CONVERT 1083x722
FOR /F %i IN ('dir /b *.jpg') DO @convert "%i" -strip -resize "1083x722^" -gravity Center -crop "1083x722+0+0" "%~ni".jpg
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -m comment --comment "allow established sessions to receive traffic"
iptables -I INPUT -p tcp --dport 1723 -j ACCEPT -m comment --comment "allow PPTPD"
iptables -I INPUT -p tcp --dport 22 -j ACCEPT -m comment --comment "allow SSH"
iptables -I INPUT -p gre -j ACCEPT -m comment --comment "allow GRE protocol"
iptables -A INPUT -p icmp --icmp-type 0 -m state --state ESTABLISHED,RELATED -j ACCEPT -m comment --comment "allow icmp"
iptables -A INPUT -i lo -j ACCEPT -m comment --comment "allow loopback"
iptables -A INPUT -j DROP -m comment --comment "block everything else"
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE -m comment --comment "masquerade network on eth0"
#save to file all the rules