Skip to content

Instantly share code, notes, and snippets.

View Sergi030's full-sized avatar
:octocat:
:octocat: :octocat: :octocat:

Sergi García Ibáñez Sergi030

:octocat:
:octocat: :octocat: :octocat:
View GitHub Profile
@Sergi030
Sergi030 / bandwidth.sh
Created April 20, 2018 16:40
Script to check bytes usage on a specific network card using system files
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
exit
@Sergi030
Sergi030 / entropy.py
Created June 5, 2018 09:18
Python script that do a dd of 1k on /dev/random 10 times and tell the wasted time
import subprocess
import os
import timeit
import time
def read_dev_random():
devnull = open(os.devnull, 'w')
subprocess.check_call(['dd', 'if=/dev/random', 'of=mytmp', 'bs=1k', 'count=1'],stdout=devnull, stderr=devnull)
@Sergi030
Sergi030 / show_tarball_replacing_files.sh
Last active January 31, 2023 18:36
show_tarball_replacing_files
#!/bin/bash
if [ $# -ne 1 ]
then
echo "$@ <tarfile>"
exit 1
fi
if [ ! -f $1 ]
then