Skip to content

Instantly share code, notes, and snippets.

@kn9
kn9 / gogg-translate.css
Created February 26, 2022 16:57
Custom Google Translate (Mobile-friendly) - customized to be mobile friendly without breaking google licensing
#google-translate-container {
float: right;
padding: 3px 5px 0px 0px;
}
.goog-te-combo,
.goog-te-banner *,
.goog-te-ftab *,
.goog-te-menu *,
.goog-te-menu2 *,
@kn9
kn9 / instapy-example.py
Created February 26, 2019 08:41 — forked from dublado/instapy-example.py
Instapy example
from instapy import InstaPy
#if you don't provide arguments, the script will look for INSTA_USER and INSTA_PW in the environment
session = InstaPy(username='clubedelider', password='pass', headless_browser=True)
'''
session.set_relationship_bounds(enabled=True,
potency_ratio=1.34,
delimit_by_numbers=True,
max_followers=850000,
@kn9
kn9 / ajenti-v-php7.sh
Last active August 21, 2021 02:47
Ubuntu Nginx Web Server with Ajenti with PHP 7.0
#Insall Ajenti
apt-get update
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti -y
service ajenti restart
# Uninstall Apache2
sudo apt-get autoremove && sudo apt-get remove apache2* -y
@kn9
kn9 / ONPAWD.sh
Created November 26, 2016 21:37
The Perfect Web Server - OpenSSL, Nginx, MySQL (PostgreSQL), Ajenti, Wordpress, Debian 7.x
# This file is zentralized to be a Turorial.
# I'm not sure about the full selfish-work.
# We will isntall OpenSSL,NginX,PostgreSQL.
# Than we will isntall Ajenti.
# Than you must configurate Ajenti to not use SSL (we will changethis later back)
# Followed we install Wordpress and you will have to install some plugins for PSQL and Nginx.
# Ready to press words!
# ----------
#remove instalaltion hardware ofthe sources.list
nano /etc/apt/sources.list
# downgrade to php5.4 first
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable -y
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5
# install ajenti
wget -O- https://raw.github.com/Eugeny/ajenti/master/scripts/install-ubuntu.sh | sudo sh
@kn9
kn9 / gist:afaf8b9425c1aab5a000765495764ccc
Last active March 14, 2017 21:18 — forked from seanmcn/gist:62a021a765ad4f8e593b
The Perfect Web Server - Nginx, Ajenti, Ubuntu
#Insall Ajenti
apt-get update
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti
service ajenti restart
# Uninstall Apache2
sudo apt-get autoremove && sudo apt-get remove apache2*
@kn9
kn9 / 1-server.md
Created November 26, 2016 21:21 — forked from dragonjet/1-server.md
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
@kn9
kn9 / Windows10-Setup.ps1
Created June 16, 2016 07:57 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0

Nginx Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400,000 to 500,000 requests per second (clustered), most what i saw is 50,000 to 80,000 (non-clustered) requests per second and 30% CPU load, course, this was 2xIntel Xeon with HT enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

First, you will need to install nginx, my way to install nginx is compiling it from source, but for now we will use apt-get

@kn9
kn9 / SFTP-SERVER-HOWTO.md
Created March 3, 2016 17:21 — forked from anonymous/SFTP-SERVER-HOWTO.md
SFTP Server Howto

Simple, secure file server (SFTP)

**SFTP - Wikipedia **

##Requirements

  • Server machine with dedicated 10+GB drive, 512MB RAM
  • Wired server <-> internet connection during Debian installation
  • Client machine (Linux,Windows,Mac,Mobile...)