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 | |
if (count($argv) < 6) { | |
echo ' | |
Usage : | |
> php ' . $_SERVER['SCRIPT_FILENAME'] . ' | |
source_folder | |
destination_folder | |
source_charset |
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
<html> | |
<head> | |
<title>Mass MySQL database character set changer</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
</head> | |
<body> | |
<pre><?php | |
$db_host = 'localhost'; | |
$db_user = 'root'; |
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 | |
function array_make_first(&$array, $element) { | |
if (($ndx = array_search($element, $array)) !== false) { | |
unset($array[$ndx]); | |
array_unshift($array, $element); | |
} | |
} | |
$encler = mb_list_encodings(); |
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 //İ | |
define('_K','b7f3l0h'); | |
define('U_IPC',true); | |
define('U_U','test'); | |
define('U_P','test'); | |
define('U_UA',$_SERVER['HTTP_USER_AGENT']); | |
define('U_IP',$_SERVER['REMOTE_ADDR']); | |
// todo: secure this (i.e. include in the logged in part) | |
if (isset($_GET['dl'])) |
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 | |
if (!empty($_POST) && isset($_FILES['file']) | |
&& $_FILES['file']['error'] == UPLOAD_ERR_OK | |
) { | |
header( | |
'Content-Disposition: attachment; filename="' | |
. $_FILES['file']['name'] . '.gz";' | |
); | |
echo gzencode(file_get_contents($_FILES['file']['tmp_name'])); | |
exit; |
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
taskkill /F /IM explorer.exe | |
cd /d %userprofile%\AppData\Local | |
attrib –h IconCache.db | |
del IconCache.db | |
start explorer |
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
@echo off | |
REM Helps securing Skype profile by storing it in a TrueCrypt drive | |
REM 1. Create the container if you don't have it | |
REM 2. Disable auto starting of Skype on Windows Start | |
REM 3. Log out and completely exit Skype | |
REM 4. Move %APPDATA%\Skype into the container, e.g. K:\AppData\Skype | |
REM 5. mklink /D "%APPDATA%\Skype" "K:\AppData\Skype" | |
REM 6. Add a shortcut like `C:\Code\truecrypt_skype.bat D:\test\example.tc` | |
REM to "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup" |
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 | |
/** | |
* A function that can insert at both integer and string positions | |
* | |
* @param array $array | |
* @param int|string $position | |
* @param mixed $insert | |
*/ | |
function array_insert(&$array, $position, $insert) |
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 | |
min_args=2 | |
if [[ $# < $min_args ]]; then | |
echo "At least $min_args arguments are required." | |
exit 1 | |
fi | |
source_dir=${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
GIT_WORK_TREE=/home/user/public_html git checkout -f |