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="notification@email.com" |
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/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
#!/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
<?php | |
$link = mysql_connect($mysql_host,$mysql_user,$mysql_pass) or die('Could not connect: '.mysql_error()); | |
mysql_select_db($mysql_db,$link) or die('Could not select database: '.$mysql_db); | |
$query = "SELECT * FROM $tablename ORDER BY id"; | |
$result = mysql_query($query) or die("Error executing query: ".mysql_error()); | |
$row = mysql_fetch_assoc($result); | |
$line = ""; | |
$comma = ""; | |
foreach($row as $name => $value) |
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <pwd.h> | |
int main(int argc, char* argv[]) | |
{ | |
if(argc != 3) | |
{ | |
printf("Usage: %s [USERNAME] [COMMAND]\n",argv[0]); |
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,pwd,os | |
pw = pwd.getpwnam(sys.argv[1]) | |
os.initgroups(sys.argv[1],pw.pw_gid) | |
env={"TERM":"xterm","USER":pw.pw_name,"HOME":pw.pw_dir,"SHELL":pw.pw_shell,"LOGNAME":pw.pw_name,"PATH":"/usr/bin:/bin:/opt/bin"}; | |
os.setgid(pw.pw_gid); | |
os.setuid(pw.pw_uid); | |
os.execve(sys.argv[2],[],env); |
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 Crypto.Cipher.DES as des | |
import Crypto.Cipher.DES3 as des3 | |
def mac_x919(key,data): | |
while len(data) % 8 != 0: | |
data += '\x00' | |
des_key1 = des.new(key[0:8],des.MODE_CBC) | |
des_key2 = des.new(key[0:8],des.MODE_ECB) |
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
<?php | |
/********************* START CONFIGURATION *********************/ | |
$DB_SRC_HOST='localhost'; | |
$DB_SRC_USER='root'; | |
$DB_SRC_PASS='password'; | |
$DB_SRC_NAME='database1'; | |
$DB_DST_HOST='localhost'; | |
$DB_DST_USER='root'; |
OlderNewer