Skip to content

Instantly share code, notes, and snippets.

View LogIN-'s full-sized avatar
:electron:
Working from space

LogIN-

:electron:
Working from space
  • WWW
View GitHub Profile
<?php
function getRemotePage($url){
require_once(user_agents.inc.php");
$user_agent = $rand_keys = array_rand($user_agents, 1);
$user_agent = $user_agents[$user_agent];
$user_ip = long2ip(rand(0, "4294967295"));
<?php
$user_agents = array();
$user_agents[] = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )';
$user_agents[] = 'Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)';
$user_agents[] = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5';
$user_agents[] = 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9';
$user_agents[] = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7';
$user_agents[] = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.14 (KHTML, like Gecko) Chrome/9.0.601.0 Safari/534.14';
@LogIN-
LogIN- / heartbeat.sh
Created April 15, 2014 14:14
Monitor and automate server status checks. It should be run as cron job.
#!/bin/bash
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# heartbeat - 03/02/2014 - heartbeat.bash - v1.00 #
# ---------------------------------------------------------------------#
# This script checks some crucial LAMP server VARIABLES #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# TODO: - send email in case of error and SMS failure #
# - automatic servicies restarting (Web/Database/Mail**) #
# - slow mysql queries check #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
@LogIN-
LogIN- / nginx_ssl.conf
Created April 15, 2014 14:22
Secure Nginx SSL conf
########## SSL Directives
ssl on;
ssl_certificate ssl-unified.crt;
ssl_certificate_key ssl.key;
# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
ssl_dhparam dhparm.pem;
#ssl_session_cache shared:SSL:50m;
ssl_session_cache builtin:1000 shared:NginXSSl:10m;
@LogIN-
LogIN- / nice_svg_js.circle.html
Created May 19, 2014 18:53
Javascript countdown circle
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Pure Javascript CountDown</title>
<meta name="description" content="Pure Javascript CountDown">
<meta name="author" content="FlopUp.Net">
<style type="text/css">
#!/bin/bash
wget -q -O - https://mail.google.com/a/gmail.com/feed/atom --http-user=${1} --http-password="${2}" --no-check-certificate | grep -oP '(?<=<fullcount>).*?(?=</fullcount>)'
@LogIN-
LogIN- / node_mouse.cc
Created September 30, 2014 11:49
Node native module control mouse position coordinates
#include <node.h>
#include <v8.h>
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
using namespace node;
using namespace v8;
@LogIN-
LogIN- / bindingQT.gyp
Created September 30, 2014 13:41
including flags for QT framework simple in binding.gyp - node native module. If error possible solution is to add path: export LD_LIBRARY_PATH=/home/xxx/Qt/5.3/gcc/lib/
{
"targets": [{
"target_name": "CutyCapt",
"sources": ["CutyCapt.cc"],
'conditions': [
['OS=="linux"', {
'cflags': [
'-fPIC',
'-std=c++11',
'<!@(pkg-config --cflags Qt5Core Qt5Svg Qt5WebKit Qt5WebKitWidgets Qt5Network)'
@LogIN-
LogIN- / portcheck.cc
Last active August 29, 2015 14:07
Check free port node native addon
#include <node.h>
#include <v8.h>
#include <stdio.h>
#include <time.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
@LogIN-
LogIN- / numb_words.php
Created October 4, 2014 11:09
PHP Convert numbers to words
<?php
function ThreeDigitsInWords($Number){
if ($Number == 0){
return "";
}
$InWords = "";
$Units_Place = array("zero","one","two","three","four","five","six","seven","eight","nine");
$Tens_Place = array(1=>"ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety");