Skip to content

Instantly share code, notes, and snippets.

@rafaelbiriba
rafaelbiriba / install_ffmpeg_libfdkaac.sh
Last active July 25, 2024 03:04
Install FFmpeg with libfdk_aac support (For Ubuntu)
# Criando um script .sh para executar todos os comandos:
#root@servidor:~# vi script.sh
#root@servidor:~# chmod +x script.sh
#root@servidor:~# ./script.sh
apt-get update
apt-get -y install autoconf automake build-essential git-core libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev nasm gcc yasm && true
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
@brihter
brihter / opencart_fix_indexes.sql
Last active September 19, 2023 11:26
The script will generate the missing opencart indexes. Copy the result and execute it on the target schema.
use information_schema;
select
concat('alter table `', c.table_name, '` add index `ix_', c.column_name, '` (`',c.column_name,'`);')
from columns c
where c.table_schema = 'SCHEMA_NAME'
and lower(c.column_name) like '%_id%'
and c.column_key = '';
@Aikhjarto
Aikhjarto / block_badips.sh
Last active April 8, 2021 15:54
Fetch a list of known brute force attackers from badips.com and apply/update iptables DROP rules
#!/bin/bash
# This script downloads a list of IPs known for brute force attacking within the last two weeks.
# The fetched IPs get blocked with iptables with the special comment "BADIP". This script only
# modifies iptables rules with that comment. This measure makes it well compatible with other firewall
# scripts like the SUSEFirewall.
# The iptables rules are updated every time this script is executed. Additionally this script is
# quiet on stdout, which makes it well suited for being executed as a cronjob.
#
# Please also use fail2ban with the badips modification and help to maintain the list of attackers.
# See also: fail2ban and http:///www.badips.com
@microlinux
microlinux / zping.sh
Last active August 28, 2023 13:28
Bash script for storing ping data in RRDs and graphing that data
#!/bin/bash
#
# INSTALL
# -------
# 1.) Create directory structure
# <base_dir>
# <base_dir>\bin
# <base_dir>\etc
# <base_dir>\log
# <base_dir>\rrd
@drmalex07
drmalex07 / README-create-debian-startup-script.md
Last active September 15, 2024 02:28
An example of how to create a init.d script in Debian, using dependency booting. #debian #init.d #lsb-script #startup-script
@cabal95
cabal95 / vm-backup.sh
Created July 25, 2015 17:53
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@mustafaakin
mustafaakin / README.md
Last active May 31, 2023 05:28
Running Windows Server 2k16 with Docker under Linux, KVM or Virtualbox

Are you let down when you saw there is no guide to use Windows Server 2016 under *nix environments? I really loved Microsoft when I heard they are working on Windows containers, but when this week has arrived, it was sad to see that installation requirements were Windows and HyperV. But actually it is not. You just have to modify the VHD file a bit with nicer tools and execute the already available script in the downloaded VM. I will assume you are running a decent version of Linux and accepted EULA and all the legal stuff that I do not care.

1. Getting the required tools:

$ sudo apt-get install qemu-kvm virt-manager // or virtualbox, but we need qemu-kvm for image manipulation
$ sudo apt-get install qemu-utils libguestfs-tools // image manipulation tools

2. Downloading files

@vanDonselaar
vanDonselaar / EnableInterAMT.sh
Created January 13, 2016 21:39
Enable Intel AMT VNC using Linux
# Retrieved from: http://iranzo.github.io/blog/2015/05/01/intel-amt-on-linux-for-remote-control-slash-fencing/
ip=myhost
AMT_PASSWORD="Qwerty12#$"
# Must be exactly *8 characters long* and contain at least one of each:
# [ lower case, upper case, number, special character ]
VNC_PASSWORD="Abcdef1@"
# Enable KVM
@oboje
oboje / iPhone_ringtone.sh
Created March 17, 2016 11:25
Create iPhone ringtone from mp3 using ffmpeg
brew reinstall ffmpeg --with-faac # Needs ffmpeg with faac encoder
ffmpeg -i <input.mp3> -ac 1 -ab 128000 -f mp4 -acodec libfaac -y -ss <beggining_second> -t <length_in_seconds> ringtone.m4r # Length can't be higher than 40 seconds
@dunkelstern
dunkelstern / rc.local
Created August 7, 2016 19:14
iptables rules for vpn config
# for ISAKMP (handling of security associations)
iptables -A INPUT -p udp --dport 500 --j ACCEPT
# for NAT-T (handling of IPsec between natted devices)
iptables -A INPUT -p udp --dport 4500 --j ACCEPT
# for ESP payload (the encrypted data packets)
iptables -A INPUT -p esp -j ACCEPT
# for the routing of packets on the server
iptables -t nat -A POSTROUTING -j SNAT --to-source %IP% -o eth0
# internet access
iptables -t nat -A POSTROUTING -s 10.0.42.0/24 -o eth0 -m policy --dir out --pol ipsec -j ACCEPT