This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net.ipv4.ip_forward=0 | |
net.ipv4.tcp_fin_timeout = 60 | |
net.ipv4.tcp_retries1 = 3 | |
net.ipv4.tcp_keepalive_probes = 9 | |
net.ipv4.tcp_keepalive_time = 7200 | |
net.ipv4.tcp_syn_retries = 5 | |
kernel.sem = 250 32000 100 128 | |
kernel.shmall = 209715200 | |
kernel.shmmax = 214748364800 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install all necessary stuff | |
wget https://php.hernandev.com/key/php-alpine.rsa.pub -O /etc/apk/keys/php-alpine.rsa.pub | |
#if you encounter dns errors, replace php.hernandev with 50.116.12.38 | |
apk --update-cache add ca-certificates && \ | |
echo "https://php.hernandev.com/v3.15/php-8.1" >> /etc/apk/repositories | |
apk add --update-cache php=8.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if nginx already installed consider stopping service first, you can still reserve running this command until the actual build stage | |
#sudo service nginx stop | |
#assume you already have git libssl installed, otherwise uncomment | |
#sudo apt install libssl-dev | |
#sudo apt install git | |
cd ~ | |
git clone https://github.com/google/ngx_brotli.git | |
cd ngx_brotli | |
git submodule update --init --recursive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Make enough swap space if you have less than 2Gb memory | |
sudo swapoff -a | |
sudo fallocate -l 6G /swapfile | |
sudo chmod 0600 /swapfile | |
sudo mkswap /swapfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param mixed $color1 The first hex/rgb array gradient color | |
* @param mixed $color2 The second hex/rgb array gradient color | |
* @param mixed $weight Weight of color 1 against color 2. Should be a float between 0 and 1 | |
* @return string A hex color mix of the two gradient colors based on weight | |
*/ | |
function pick_hex($color1, $color2, $weight) { | |
$w1 = $weight; | |
$w2 = 1 - $w1; | |
if (is_string($color1)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import flac.encoder as encoder | |
import pyaudio | |
import sys | |
import requests | |
import random | |
from threading import Thread | |
from Queue import Queue, Empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Web.Mvc; | |
using System.Web.Security; | |
using Facebook; | |
using MyFacebookSite3434.Models; | |
namespace MyFacebookSite3434.Controllers | |
{ | |
public class AccountController : Controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'replacewithtablename' into @table; | |
select 'replacewithdatabasename' into @schema; | |
select concat('public class ',@table,'{') | |
union | |
select concat('public ',tps.dest,' ',column_name,'{get;set;}') | |
from information_schema.columns c | |
join ( | |
select 'char' as orign ,'string' as dest union all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Grab Images from Wikipedia via thier API | |
* | |
* @author http://techslides.com | |
* @link http://techslides.com/grab-wikipedia-pictures-by-api-with-php | |
*/ | |
//curl request returns json output via json_decode php function |