Skip to content

Instantly share code, notes, and snippets.


Sencer H. RecNes

Block or report user

Report or block RecNes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
RecNes /
Last active Jun 20, 2018
Script for automatic file system check and mount usb disk for raspberry pi raspbian
Please READ carefuly first and use at your OWN RISK!
This script is repeatedly try to mount EXT4 partition to given point.
Any other FS types are igored while writing this script. Works ONLY EXT4!
Before mounting, checks and corrects the file system errors. THIS MAY CAUSE LOSS OF DATA!
Append cronjob such as:
15 * * * * /usr/bin/python /root/
RecNes /
Last active Jun 20, 2018
Remove old hourly backups
#!/usr/bin/env python
import shutil
import os
from datetime import datetime
print(" ".join(("-"*20, "Removing Hourly Backups Older Than Today", "-"*20)))
path_to_backups = '/var/backups/sqlbackups'
today =
RecNes /
Last active Jun 20, 2018
Disk space usage email alert
#!/usr/bin/env python
Developen on: Python 2.7.13
__author__ = 'Sencer Hamarat'
__license__ = "Creative Commons Attribution-ShareAlike 3.0 Unported License"
__version__ = "1.3"
__maintainer__ = "Sencer Hamarat"
__status__ = "Production"
RecNes / locofomufowisalofo
Created Oct 26, 2017
Logrotate configuration for multiple folders with same log folder. It applies to log files which are created by unstoppable services.
View locofomufowisalofo
olddir old_logs
rotate 365
RecNes /
Last active Jun 20, 2018
Display percentage of process to on one line of stdout in python
object_list_length = len(ObjectList)
for i, object in enumerate(ObjectList):
percentage = int(((i + 1) * 100 / object_list_length))
percent_str = ""
for k in range(0, int(percentage / 5)):
percent_str += ":"
sys.stdout.write("\r%s -- %s | %s %% %s " % (str(i + 1),
RecNes / pause_sketch_for_console.ino
Created Dec 4, 2016
How to make wait/pause the sketch for Arduino IDE serial console to open.
View pause_sketch_for_console.ino
void setup() {
// Wait for the users to turn on the serial monitor and press the enter key to continue.
while (!Serial.available()) {
; // Wait for enter key;
// put your setup code here, to run once:
RecNes / 16x2lcdPrint.ino
Created Nov 18, 2016
Arduino gist for proper usage of vertical scrolling on each output with 16x2 LCD display.
View 16x2lcdPrint.ino
#include <LiquidCrystal.h>
String Line1;
String Line2;
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void lcdPrint(String lcdText) {
Line1 = Line2;
lcd.setCursor(0, 0);
RecNes /
Last active Jun 20, 2018
Shell script to use for kill all python scripts.
#!/usr/bin/env bash
# title :
# description : This script to use for kill python scripts.
# author : Sencer HAMARAT "sencerhamarat(at)"
# date : 20160202
# version : 0.1
# command : bash
# bash_version : 4.3.11(1)-release
# =============================================================================
RecNes / netextender
Created Sep 19, 2016 — forked from moonwatcher/netextender
upstart init.d script for running Dell SonicWALL NetExtender as a service. Script should be in /etc/init.d/netextender Configuration goes in /etc/default/netextender Than run: sudo update-rc.d netextender defaults
View netextender
# defaults for NetExtender Dell VPN Client
# sourced by /etc/init.d/netextender
# should be placed in /etc/default/netextender
# Enable or disable the daemon
# Path to daemon
RecNes /
Created Sep 14, 2016 — forked from johntyree/
Make one large blocklist from the bluetack lists on
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
You can’t perform that action at this time.