Skip to content

Instantly share code, notes, and snippets.

@ijokarumawak
ijokarumawak / 0.README.md
Created May 17, 2018 02:23
Docker example to run Dante SOCKS proxy server.

How to use Dante SOCKS proxy server

Create sockd.conf file locally on the docker host machine and map it with -v option of docker run.

Run socks server

docker run -d -p 1080:1080 -v /etc/sockd.conf:/etc/sockd.conf --name socks-server vimagick/dante

Add user

@hanhdt
hanhdt / 01_elastic_beanstalk_install_packages.config
Last active August 15, 2023 17:00
Setup additional linux packages on AWS Elastic Beanstalk that need to build Rails 5
# Setup linux packages
option_settings:
- option_name: BUNDLE_DISABLE_SHARED_GEMS
value: "1"
- option_name: BUNDLE_PATH
value: "vendor/bundle"
packages:
yum:
curl: []
#!/usr/bin/php
<?php
declare(strict_types = 1);
// require_once ('hhb_.inc.php');
hhb_init ();
if ($argc !== 3) {
fprintf ( STDERR, "usage: %s timestamp url\n", $argv [0] );
fprintf ( STDERR, "example: %s 20091012061648 http://www.p4w.se\n", $argv [0] );
die ( 1 );
}
@nuxero
nuxero / pagespeed_proxy_cache.config
Last active November 4, 2022 15:24
ebextension config file for pagespeed and proxy cache on nginx
files:
"/etc/nginx/pagespeed.conf":
owner: root
group: root
mode: "000644"
content: |
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
@AlexR1712
AlexR1712 / bladeCompile.php
Last active December 5, 2022 07:20
Compile a string like Blade Template in Laravel
<?php
// Only you need to add in your controller.
public function bladeCompile($value, array $args = array())
{
$generated = \Blade::compileString($value);
ob_start() and extract($args, EXTR_SKIP);
// We'll include the view contents for parsing within a catcher
// so we can avoid any WSOD errors. If an exception occurs we
@tianchaijz
tianchaijz / README.md
Created December 19, 2015 07:26 — forked from hwdsl2/.MOVED.md
IPsec L2TP VPN Auto Install Script for CentOS / RHEL 6 and 7

IPsec/L2TP VPN Auto Install Script for CentOS/RHEL

Script for automatic configuration of IPsec/L2TP VPN server on CentOS/RHEL 6 & 7 64-bit.
Works on dedicated servers or any KVM- or XEN-based Virtual Private Server (VPS).

It can also be used as the Amazon EC2 "user-data" with the official CentOS 7 AMI. Note that the official CentOS 6 AMI does NOT come with cloud-init, so you need to run this script manually after instance creation.

Alternative VPN script for Ubuntu/Debian
Original post by Thomas Sarlandie

@euharrison
euharrison / 01composer.config
Created November 12, 2015 21:55
.ebextensions Laravel
commands:
01-update-composer:
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
container_commands:
@jeffreymorganio
jeffreymorganio / uk-bounding-box.geojson
Created October 6, 2015 08:53
Longitude and latitude bounding box around the UK
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@voduytuan
voduytuan / build.xml
Created September 19, 2015 05:18
Sample build.xml for apache Ant for php project
<?xml version="1.0" encoding="UTF-8"?>
<project name="Apitoy" default="full-build">
<!-- By default, we assume all tools to be on the $PATH -->
<property name="pdepend" value="/home/jenkins/vendor/bin/pdepend"/>
<property name="phpcpd" value="/home/jenkins/vendor/bin/phpcpd"/>
<property name="phpcs" value="/home/jenkins/vendor/bin/phpcs"/>
<property name="phploc" value="/home/jenkins/vendor/bin/phploc"/>
<property name="phpmd" value="/home/jenkins/vendor/bin/phpmd"/>
<property name="phpunit" value="/home/jenkins/vendor/bin/phpunit"/>
@dlage
dlage / convert_ploop_to_simfs.sh
Last active October 27, 2023 17:11
Bash script to convert an OpenVZ ploop container back to simfs
#!/bin/sh
# ./convert_ploop_to_simfs.sh VEID
# chmod +x convert_ploop_to_simfs.sh
rsync_options='-aHAX --progress --stats --numeric-ids --delete'
partition='vz'
if [ ! -e /etc/vz/conf/$1.conf ]; then
echo "Virtual server configuration file: /etc/vz/conf/$1.conf does not exist."
exit 1
fi
if [ ! -d /$partition/private/$1/root.hdd ]; then