Skip to content

Instantly share code, notes, and snippets.

View kikoseijo's full-sized avatar
💭
42Malaga Student

Kiko Seijo kikoseijo

💭
42Malaga Student
View GitHub Profile
@kikoseijo
kikoseijo / Envoy.blade.php
Last active January 12, 2021 16:55
Laravel envoy template for Virtualmin & Webmin servers with cron jobs
@servers(['remote' => 'ks1.xxxxx.com', 'local' => '127.0.0.1'])
@include('vendor/autoload.php')
@setup
# customize this keys...
# USERNAME_HERE, DOMAIN_NAME_HERE, REPO_GROUP, REPO_NAME
$dotenv = Dotenv\Dotenv::create(__DIR__, '.env');
$dotenv->load();
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
#!/bin/bash
IFS=$'\n'
while read php_file
do
egrep -i "(mail|eval|base64_decode|str_rot13|chmod|fwrite|exec|passthru|shell_exec|system|proc_open|popen|curl_exec|curl_multi_exec|show_source|fsockopen|pfsockopen|stream_socket_client) *\(" "$php_file"
done < php_in_writable.txt
#!/bin/bash
search_dir=$(pwd)
writable_dirs=$(find $search_dir -type d -perm 0777)
for dir in $writable_dirs
do
#echo $dir
find $dir -type f -name '*.php'
done
#!/bin/bash
IFS=$'\n'
while read writable_dir
do
find "$writable_dir" -type f -not -iname '*.php' -print0 | xargs -0 egrep -i "(<\?php|<\?=|<\? *(?!(xml)))" --color
done < writable_dirs.txt
@kikoseijo
kikoseijo / pthreads_example.php
Created August 30, 2016 14:07 — forked from kamermans/pthreads_example.php
An adaptation of an example from the pthreads project that shows how to make 32 simultaneous web requests in PHP using multi-threading via pthreads.
<?php
error_reporting(E_ALL);
class AsyncWebRequest extends Thread {
public $url;
public $num;
public $data;
public function __construct($url, $num){
$this->url = $url;
@kikoseijo
kikoseijo / mysql_countries.sql
Created August 30, 2016 14:05 — forked from kamermans/mysql_countries.sql
MySQL Dump - continents and countries with 2 and 3 char codes, names and full names - Braintree compatible as of Dec 2011
/**
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree
* Payment API as of Dec 2011
*
* Compiled by Steve Kamerman, 2011
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
@kikoseijo
kikoseijo / gist:d47aa1f5339df33292a7
Last active August 28, 2021 01:37
Clean WP database - WORDPRESS R.I.P