This file contains 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 | |
# A simple countdown in Bash | |
echo -n "countdown..." | |
for i in 1 2 3 4 5 6 7 8 9 10 | |
do | |
echo -n -e "\rcountdown... ${i}" | |
sleep 1 | |
done | |
echo -e "\nDONE!" |
This file contains 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 | |
TMP_FOLDER="/root/daily_backup" | |
MYSQL_FOLDER="${TMP_FOLDER}/MYSQL" | |
WWW_FOLDER="${TMP_FOLDER}/WWW" | |
LOCAL_WWW_FOLDER="/var/www/vhosts" | |
FTP_USER="ftp_username" | |
FTP_PASS="ftp_password" | |
FTP_HOST="ftp_host" | |
MAIL_ALERT="[email protected]" |
This file contains 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 | |
set -e | |
FTP_USER="ftp_user" | |
FTP_PASS="ftp_password" | |
FTP_HOST="ftp_host" | |
# REMOVE BACKUPS OLDER THAN 7 DAYS | |
FILES=$(lftp -e 'cd pleskbackup; cls --sort="date"; exit;' -u ${FTP_USER},${FTP_PASS} ${FTP_HOST}) | |
if [ $(echo "${FILES}" | wc -l) -gt 7 ]; |
This file contains 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 | |
FIRST_REV=${1} | |
LAST_REV=${2} | |
REPO_ROOT=${3} | |
if [ -z "${FIRST_REV}" ] || [ -z "${LAST_REV}" ] || [ -z "${REPO_ROOT}" ] | |
then | |
echo "usage: ${0} first_revision last_revision repository_root" | |
exit 1 |
This file contains 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 python | |
import binascii | |
def CRC32_from_file(filename): | |
buf = open(filename,'rb').read() | |
buf = (binascii.crc32(buf) & 0xFFFFFFFF) | |
return "%08X" % buf |
This file contains 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/php | |
<?php | |
$sendmail = '/usr/sbin/sendmail'; | |
$logfile = '/var/log/mail_php.log'; | |
/* Get email content */ | |
$logline = ''; | |
$mail = ''; | |
$fp = fopen('php://stdin', 'r'); |
This file contains 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 sys | |
if sys.version_info < (3,0): | |
import Tkinter as tkinter | |
import tkMessageBox as mbox | |
else: | |
import tkinter | |
import tkinter.messagebox as mbox | |
window = tkinter.Tk() |
This file contains 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/python | |
# -*- coding: utf-8 -*- | |
from PySide.QtGui import * | |
from PySide.QtCore import * | |
from myapplication_ui import * | |
class MyApplication(QtGui.QMainWindow, Ui_MainWindow): | |
def __init__(self, parent=None): |
This file contains 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 python | |
import sys | |
def toNumber(buf): | |
""" Convert string in number """ | |
size = 0 | |
for b in buf: size=size*256+ord(b) | |
return size |
This file contains 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 python2 | |
import sys, time | |
from PySide.QtGui import * | |
from PySide.QtCore import * | |
class MySignal(QObject): | |
sig = Signal(str) | |
class MyLongThread(QThread): |
OlderNewer