Skip to content

Instantly share code, notes, and snippets.

@rubo77
rubo77 / traffic-analysis.sh
Last active August 29, 2015 14:26
analyses the number of clients that cause traffic during a given time on a Freifunk gateway
duration=$1
tmp=/tmp/traffic.tmp
localnet="10.116.128.0/17"
iface=br-ffki
echo capturing for $duration seconds
(
sleep $duration
pkill -f tcpdump
) &
@BR0kEN-
BR0kEN- / string_functions.sh
Created June 8, 2015 11:25
Bash implementation of strpos and substr functions from PHP library
#!/usr/bin/env bash
# @param string $1
# Input string.
# @param int $2
# Cut an amount of characters from left side of string.
# @param int [$3]
# Leave an amount of characters in the truncated string.
substr()
{
required types
--------------
- [X] Block allocation/freeing/delegation
- [ ] request for block owner
- [ ] lease renewal (proxy)
- [ ] lease renewal response (proxy)
Allocate Block
@rubo77
rubo77 / ln-conv-hl
Last active December 15, 2020 10:54
convert hard-links to symbolic links
#!/bin/bash
#
# converts hard-links to symbolic links
#
#-------------- Author: -------------#
# by Ruben Barkow
# git: https://gist.github.com/7a9a83695a28412abbcd.git
#--- Copyright and license -----------#
#This code is covered by the GNU General Public License 3.
@vekexasia
vekexasia / fix_ubuntu.sh
Last active August 29, 2015 14:06
Fix Bash Bug 'Shell Shock' ubuntu
sudo apt-get -y install build-essential
mkdir src
cd src
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
#download all patches
for i in $(seq -f "%03g" 0 25); do wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done
tar zxvf bash-4.3.tar.gz
cd bash-4.3
#apply all patches
for i in $(seq -f "%03g" 0 25);do patch -p0 < ../bash43-$i; done
@rubo77
rubo77 / mount-root
Last active May 25, 2023 08:22
Mounts all needed mount points to change into another system from within a live-CD
#!/bin/bash
# mounts all needed mount points to change into another system from within a live-CD
#-------------- Author: -------------#
# by Ruben Barkow (Rubo77)
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
echo "You must be root to run this script!"; echo "use 'sudo !!'"; exit 1
fi
@lanceliao
lanceliao / 0-openwrt-auto-mount-readme.md
Last active April 21, 2024 14:19
Auto mount USB storage device by uuid on OpenWrt
  1. Install USB device support;
opkg install kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-storage e2fsprogs fdisk usbutils mount-utils block-mount kmod-fs-ext4 kmod-fs-vfat kmod-nls-utf-8 kmod-nls-cp437 kmod-nls-iso8859-1

reboot
  1. Install blkid, run opkg update && opkg install blkid;
  2. Copy block.sh to directory /lib/functions;
  3. Copy 10-mount and 20-swap to directory /etc/hotplug.d/block;
  4. That's it! run logread -f command then plug in a USB stick to test.
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@Noitidart
Noitidart / _ff-addon-template-bootstrapPrefsSkeleton.js
Last active July 2, 2018 09:30
_ff-addon-template-bootstrapPrefsSkeleton - Shows the bare minimum I use for my addons with preferences. Utilizes inline options interface.
// naming gist
@Avyd
Avyd / Compile to .deb
Last active September 23, 2021 09:33
Compile kernel to installable .deb package
#Install necessary things
apt-get update
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential -y
#Get the kernel
cd /usr/src
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.13.tar.xz
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.13.tar.sign
gpg --verify linux-3.13.tar.sign
tar xpvf linux-3.13.tar.xz