Skip to content

Instantly share code, notes, and snippets.

@kaanuki
kaanuki / WiFiCheck
Created May 7, 2016 12:01 — forked from mharizanov/WiFiCheck
Script to check and re-connect WiFi on Raspberry Pi
#!/bin/bash
##################################################################
# A Project of TNET Services, Inc
#
# Title: WiFi_Check
# Author: Kevin Reed (Dweeber)
# [email protected]
# Project: Raspberry Pi Stuff
#
# Copyright: Copyright (c) 2012 Kevin Reed <[email protected]>
@kaanuki
kaanuki / spin.js
Created July 25, 2016 23:22 — forked from irazasyed/spin.js
JavaScript: Text Spinner Function
/* ============================================================
| :=Text Spinner
=============================================================== */
function preg_quote(str, delimiter) {
return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&');
}
function spin(text) {
var matches = text.match(/{[^<]+/gi);
if (matches === null) {
@kaanuki
kaanuki / read-write-file.js
Created November 28, 2016 13:07
Read Write to file with javascript
/// write to file
var txtFile = "c:/test.txt";
var file = new File(txtFile);
var str = "My string of text";
file.open("w"); // open file with write access
file.writeln("First line of text");
file.writeln("Second line of text " + str);
file.write(str);
file.close();
<!doctype>
<html>
<head>
</head>
<body>
<?php
require_once "Classes/PHPExcel.php";
$tmpfname = "test.xlsx";
@kaanuki
kaanuki / gist:5c82cdfb0f18c4606f1f4f45190ce3a0
Created December 19, 2016 19:18
scrapy yellowpages spider
from scrapy.spider import Spider
from scrapy.selector import Selector
from yp.items import YpItem
class YpSpider(Spider):
name = "yp"
allowed_domains = ["yellowpages.com"]
start_urls = [
"http://www.yellowpages.com/ft-worth-tx/churches?g=ft.%20worth%2C%20tx&q=churches"
]
@kaanuki
kaanuki / py2php.py
Created March 13, 2017 12:27 — forked from reusee/py2php.py
Python to php translator, compile python script to php
import ast
from cStringIO import StringIO
import sys
INFSTR = '1e308'
def interleave(inter, f, seq):
seq = iter(seq)
try:
f(next(seq))
@kaanuki
kaanuki / loadCSV.php
Created May 15, 2017 15:41 — forked from josephspurrier/loadCSV.php
Parse a CSV file in PHP, remove hidden characters, escape fields to prepare for MySQL, and return an associative array.
// Auto detect line endings
ini_set('auto_detect_line_endings', true);
function loadCSV($file)
{
// Create an array to hold the data
$arrData = array();
// Create a variable to hold the header information
$header = NULL;
@kaanuki
kaanuki / .htaccess
Created July 10, 2017 12:17 — forked from mreidsma/.htaccess
Simple click tracking script
// .htaccess
//
// Add this to the directory where your write.php will be stored
// This is an easy way to do an HTTP request to the script with the data
<IfModule mod_rewrite.c>
RewriteEngine On
# Change the following to the base directory of this file
RewriteBase /clickstats/
@kaanuki
kaanuki / free_email_provider_domains.txt
Last active July 22, 2017 21:50 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
@kaanuki
kaanuki / How to Secure phpMyAdmin.txt
Last active October 12, 2017 04:54
How to Secure phpMyAdmin
How to Secure phpMyAdmin
Some tips to add an extra layer of protection to your phpmyadmin. Vesta Control Panel is really good but it seems like its lacking in the security department so I want to help as much as possible.
Add htaccess login (extra login)
more info: https://degreesofzero.com/article/how-to-secure-phpmyadmin.html
Change the default /phpmyadmin alias to something like /phpmyadmin-vcn0vgu02j0239f
more info: https://forum.vestacp.com/viewtopic.php?f=10&t=5264 (thanks john)
check your config locations here: http://vestacp.com/docs/#config-log-location-rhel-centos