This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Scripted from http://serverfault.com/questions/127636/force-local-ip-traffic-to-an-external-interface | |
DEV_0="ens6f0" | |
DEV_1="ens6f1" | |
MAC_0=`ifconfig $DEV_0 | tr -s '\t' ' ' | grep -oE 'ether[ ]+([0-9a-f]{2}:)+[0-9a-f]{2}' | cut -d ' ' -f2` | |
MAC_1=`ifconfig $DEV_1 | tr -s '\t' ' ' | grep -oE 'ether[ ]+([0-9a-f]{2}:)+[0-9a-f]{2}' | cut -d ' ' -f2'` | |
IP_0="192.168.100.1" | |
IP_1="192.168.101.1" | |
FAKE_0="192.168.102.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
help=" | |
Multidimesionnal sequence | |
Generate every possible sequence consisting from n integer values, each from n-th range. | |
Range can be defined as: | |
* <k> - range from 1 to <k> inclusively | |
* <k>..<l> - range from <k> to <l> inclusively | |
* <k>..<l>..<m> -range from <k> to <m> with incremetn of <l> inclusively |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
URL='https://perelki.net/random' | |
function get_joke { | |
current_dir="$PWD" | |
cd /tmp | |
wget "$URL" --quiet | |
from_line="$(fgrep '<!-- POCZATEK -->' ./random -n | cut -d: -f1)" | |
to_line="$(fgrep '<!-- KONIEC -->' ./random -n | cut -d: -f1)" | |
joke="$(head -n $to_line ./random | tail -n $(($to_line - $from_line +1)) - | fgrep '<br />' | tr "\r" -d | sed 's/<br \/>/\n/g')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# the script comes from this site: customlinux.blogspot.com/2013/02/pavolumesh-control-active-sink-volume.html | |
# This is an updated version that works with ubuntu 18.04 and sends notifications to awesome window manager via awesome-client. Remember - I'am not an original author of the script. | |
# finds the active sink for pulse audio and increments the volume. useful when you have multiple audio outputs and have a key bound to vol-up and down | |
inc='5' | |
capvol='yes' | |
maxvol='200' | |
tmpfile='/tmp/pasink.tmp' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env/python3 | |
import calendar | |
import time | |
from subprocess import check_output | |
import os | |
DISKS = (' /home',' /', ' /home/windows', ' /media/backup') | |
TMUX_CHEATSHEET = """ │ | |
Sessions │ Panes (splits) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
blacklist = open("/home/mroz/workspace/coin-hoster/blacklist.txt",'r') | |
domains = set() | |
wildcards = set() | |
domain_matcher = re.compile("[^/]+//(\*\.)?(?P<domain>[^/]+)") | |
for line in blacklist: | |
try: | |
domains.add(domain_matcher.match(line).groupdict()['domain']) | |
except: | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# author: mroz | |
# email: [email protected] | |
# page: github.com/mrozo | |
# license: BSD 2-Clause License | |
# Copyright (c) 2016, mroz | |
# | |
# Flask sqlalchemy + Flask jsontools example. | |
# This file shows how to join those two Flask extensions in order to create a restful api for accessing the database. | |
# |