Klemen Tušar techouse
- Ljubljana, Slovenia
- Sign in to view email
- https://www.linkedin.com/in/techouse/
View timemachine_exclude_dev_dirs.sh
#!/usr/bin/env bash | |
# This simple bash script is aimed at excluding some development specific directories. | |
# | |
# In this configuration it will instruct Time Machine to exclude directories named: | |
# - env | |
# - node_modules | |
# - vendor | |
# - venv | |
# |
View weekOfMonth.js
import { | |
differenceInDays, | |
startOfMonth, | |
startOfWeek, | |
getDate | |
} from 'date-fns' | |
const weekOfMonth = function (date) { | |
const firstDayOfMonth = startOfMonth(date) | |
const firstDayOfWeek = startOfWeek(firstDayOfMonth) |
View InsertIgnore.php
<?php | |
namespace App; | |
trait InsertIgnore | |
{ | |
/** | |
* @param array $attributes | |
* | |
* @return static |
View php_depcheck.pl
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use utf8; | |
use IO::File; | |
use IO::Handle; | |
use File::Find::Rule; | |
use File::Spec; | |
use Text::CSV_XS; | |
use Cwd qw(abs_path); |
View blacklist.py
#!/usr/bin/env python3 | |
__author__ = "Klemen Tušar" | |
__email__ = "techouse@gmail.com" | |
__copyright__ = "GPL" | |
__version__ = "1.0.2" | |
__date__ = "2017-01-06" | |
__status__ = "Production" | |
import re, subprocess |
View iptables_countryban.pl
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use File::Basename; | |
use IO::File; | |
my $debug = 0; | |
my $restore = defined $ARGV[0] && $ARGV[0] eq '--restore' ? 1 : 0; # optional --restore command line argument | |
my $config_file = dirname(__FILE__) . '/iptables_configuration.txt'; |
View psky.sh
#!/bin/sh | |
if [[ -z $1 ]] ; then | |
echo "psky.sh <IP>" | |
echo "" | |
echo "Protected SKY IP checker" | |
echo "Check if the given IP is blacklisted" | |
echo "" | |
return 1; | |
fi | |
REVERSE=$(echo $1 | awk -F '.' '{ print $4 "." $3 "." $2 "." $1 }') |
View insultme.sh
#!/bin/sh | |
# This script will give you a random English insult pulled from the url below. | |
# Evil hint: set up a cronjob :D | |
curl -s 'http://www.hyperhero.com/en/insults.htm' | | |
awk '/BEGINN INSULTS/ { show=1; next } /END INSULTS/ { show=0 } show' | | |
grep -oPi '^.*<br>' | | |
sed 's/<br>//' | | |
shuf -n 1 | |
View send_mail.py
#!/usr/bin/env python3 | |
__author__ = "Klemen Tušar" | |
__email__ = "techouse@gmail.com" | |
__copyright__ = "GPL" | |
__version__ = "1.0.2" | |
__date__ = "2017-02-22" | |
__status__ = "Production" | |
import os, smtplib, validators |
View sqlite3mysql.py
#!/usr/bin/env python3 | |
import logging | |
import sqlite3 | |
import sys | |
import re | |
from math import ceil | |
from os.path import realpath, isfile | |
import mysql.connector | |
from mysql.connector import errorcode |
NewerOlder