Skip to content

Instantly share code, notes, and snippets.

View vrkansagara's full-sized avatar
😀
Coding :-)

Vallabh Kansagara vrkansagara

😀
Coding :-)
View GitHub Profile
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@vrkansagara
vrkansagara / linux_performance.md
Last active March 7, 2018 16:03 — forked from marianposaceanu/linux_performance.md
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@vrkansagara
vrkansagara / ocp.php
Created December 5, 2017 05:19 — forked from ck-on/ocp.php
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@vrkansagara
vrkansagara / gist:df5df011bc36a51ce0fa6c7b0de84386
Created November 27, 2017 14:43 — forked from benleov/gist:292fb7ee692e830f5dd1
Sample SOAP Client running over SSL(TLS)
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.net.URLConnection;
import java.security.InvalidKeyException;
import java.security.KeyManagementException;
@vrkansagara
vrkansagara / example.php
Created October 25, 2017 14:06 — forked from ralphschindler/example.php
Zend\Db\Sql\Select example usage
<?php
use Zend\Db\Sql\Select;
// basic table
$select0 = new Select;
$select0->from('foo');
// 'SELECT "foo".* FROM "foo"';
@vrkansagara
vrkansagara / spider.php
Created October 25, 2017 14:06 — forked from ralphschindler/spider.php
Script to be used with PHP's built-in webserver to proxy and spider a site on click
<?php
// start PHP with: php -S localhost:8888 -t . spider.php
$site = 'http://www.targetwebsite.org/';
$path = $_SERVER["REQUEST_URI"];
if ($path == '/') {
$path = '/index.html';
<?php
setup();
$t = new Tree('top', 'T');
$t->append(new TreeNode('one', 1));
$t->append($x = new TreeNode('two', 2));
$t->append(new TreeNode('three', 3));
$t->append(new TreeNode('foo', 'foo'));
@vrkansagara
vrkansagara / tree.php
Created October 25, 2017 14:06 — forked from ralphschindler/tree.php
'tree' console command, in PHP.
#!/usr/bin/php
<?php
/**
* Because you want "tree", but cannot find the source code quick enough
* on the web to compile for OS.X or there is no suitable implementation
* on windows.
*/
// set error reporting
error_reporting(E_STRICT | E_ALL);
@vrkansagara
vrkansagara / beanstalkd.conf
Created July 13, 2017 00:13 — forked from seyhunak/beanstalkd.conf
Beanstalkd - Supervisord
### /etc/supervisor/conf.d/beanstalkd.conf
[program:beanstalkd]
command=/usr/local/bin/beanstalkd.sh
directory=/home/rails
user=ubuntu
startsecs=10
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/beanstalkd.log
@vrkansagara
vrkansagara / letsencrypt.yourdomain.conf
Created April 4, 2017 20:09 — forked from nwgat/letsencrypt.yourdomain.conf
lighttpd letsencrypt ssl conf
combine files into ssl.pem
sudo su (login as root)
cd /etc/letsencrypt/live/yourdomain
cat privkey.pem cert.pem > ssl.pem
Forward Secrecy & Diffie Hellman Ephemeral Parameters
cd /etc/ssl/certs
openssl dhparam -out dhparam.pem 4096
Copy and paste the following into /etc/lighttpd/lighttpd.conf dont forget to change yourdomain to your domain