Skip to content

Instantly share code, notes, and snippets.

View koconder's full-sized avatar
:octocat:

Vincent Koc koconder

:octocat:
View GitHub Profile
@koconder
koconder / ldap.php
Last active September 4, 2022 23:09
LDAP Login Autentication and Search in PHP, no Class required PHP 5+
<?php
//Error Checking
error_reporting(E_ALL);
ini_set('display_errors', '1');
//Set User domain extention
$LDAPUserDomain = "@my.domain"; //Needs the @, but not always the same as the LDAP server domain
?><form name="input" action="ldap.php" method="post">
Username: <input type="text" name="u"> <?php echo $LDAPUserDomain;?><br />
Password: <input type="password" name="p">
@koconder
koconder / sample.php
Created February 7, 2013 12:59 — forked from zaru/sample.php
<?php
//検索キーワード
$keyword = 'アプリ';
$uri = 'http://ax.search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?term=' . urlencode($keyword) . '&media=software';
$context = stream_context_create(array('http' => array(
'method' => 'GET',
'header' =>
'User-Agent: iTunes-iPhone/4.2.1 (2; 8GB)' . "\r\n"
. 'X-Apple-Store-Front: 143462-9,2' . "\r\n"
@koconder
koconder / json_to_csv.html
Last active January 14, 2019 23:08 — forked from palesz/json_to_csv.html
Simple JSON to CSV in HTML and Javascript with External Libraries
<html>
<head>
<style>
textarea {
height: 300px;
width: 100%;
}
</style>
<script type="text/javascript">
@koconder
koconder / filetree.bat
Created May 16, 2013 14:08
Batch File Tree
@echo off
for /d %%a in (*) do dir /ad /on /s /b "%%a" >> get_dirs.txt
@koconder
koconder / edithostfilemac
Created June 10, 2013 10:22
Edit a Host File on Mountian Lion Mac
sudo vim /private/etc/hosts
dscacheutil -flushcache
@koconder
koconder / fixperms.sh
Last active January 14, 2019 23:07
cPanel Recursive Site Permissions Fix Shell Script
#! /bin/bash
#
# Date: Jan 26th 2012
# Author: Colin R.
# Revisions: Jacob "Boom Shadow" Tirey (boomshadow.net)
# Fixperms script for ServInt
#
# Fixperms script for cPanel servers running suPHP or FastCGI.
# Written for ServInt.net
# Copyright (C) 2012 Colin R.
@koconder
koconder / accent
Created July 10, 2013 13:43
Mysql Accent
# http://stackoverflow.com/questions/742205/mysql-alter-table-collation
alter table <some_table> convert to character set utf8 collate utf8_unicode_ci;
@koconder
koconder / composer.sh
Created September 9, 2013 10:45
Install Composer Globally on Cent OS
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/bin/composer
@koconder
koconder / fix_tt.sh
Created October 3, 2013 14:53
Update all Timthumb Files across Cpanel Users
#! /bin/bash
# Detects and updates timthumb.php to latest version for all cPanel users.
# dropdeaddick.com
latest=`lynx -source http://timthumb.googlecode.com/svn/trunk/timthumb.php |grep "define ('VERSION'" $file |cut -f4 -d"'"`
if [ -z "$latest" ]; then
echo "could not get latest timthumb release, aborting!"
exit 1
fi
for user in `awk -F':' '{ if ($3 > 499) print $0 }' /etc/passwd | grep home | cut -d':' -f1`; do
backend default {
.host = "127.0.0.1";
.port = "8080";
}
acl purge {
"localhost",
"69.195.222.132"
}
sub vcl_recv {