Skip to content

Instantly share code, notes, and snippets.

View TotalLag's full-sized avatar

Chris Phan TotalLag

View GitHub Profile
@TotalLag
TotalLag / swap.sh
Last active November 28, 2019 20:18 — forked from superbarne/gist:77bd850d5c270bf7cad4
Enable Swap
fallocate -l 4G /swapfile || sudo dd if=/dev/zero of=/swapfile count=4096 bs=1MiB && \
chmod 600 /swapfile && \
mkswap /swapfile && \
swapon /swapfile && \
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
defaultViewport: null,
args:[
'--no-sandbox',
'--ignore-certificate-errors',
'--window-size=1920,1080'
],
#!/bin/bash
sudo su
ulimit -n 99999
echo '* hard nofile 500000' >> /etc/security/limits.conf
echo '* soft nofile 500000' >> /etc/security/limits.conf
echo 'root hard nofile 500000' >> /etc/security/limits.conf
echo 'root soft nofile 500000' >> /etc/security/limits.conf
@TotalLag
TotalLag / Contract Killer 3.md
Last active February 1, 2020 14:08 — forked from tony-caffe/Contract Killer 3.md
The latest version of Bytes Unlimted ‘killer contract’ for web professionals

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Revised by Totallag : Aug 10th 2017

@TotalLag
TotalLag / EdgeMax traffic-policy shaper
Last active June 20, 2020 12:14
Prioritize via DPI and allow 100% bandwidth usage if network is idle
set firewall modify QoS description 'mark packets for QoS'
set firewall modify QoS rule 20 action modify
set firewall modify QoS rule 20 application category Voice-over-IP
set firewall modify QoS rule 20 description VoIP
set firewall modify QoS rule 20 modify mark 20
set firewall modify QoS rule 40 action modify
set firewall modify QoS rule 40 application category Games
set firewall modify QoS rule 40 description Games
set firewall modify QoS rule 40 modify mark 40
@TotalLag
TotalLag / win-runas.py
Created July 15, 2020 02:29
Re-run the program with admin rights in Python
import sys
import ctypes
def is_admin():
try:
return ctypes.windll.shell32.IsUserAnAdmin()
except:
return False
if is_admin():
@TotalLag
TotalLag / EdgeMax advanced-queue QoS
Last active August 5, 2020 03:57
An upgrade from traffic-policy shaper
set traffic-control advanced-queue root queue 1 bandwidth 50mbit
set traffic-control advanced-queue root queue 1 attach-to global
set traffic-control advanced-queue queue-type sfq SFQ_DOWN
set traffic-control advanced-queue queue-type fq-codel FQCODEL_UP ecn disable
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN target 5ms
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN quantum 1514
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN limit 1001
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN interval 50ms
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN flows 1024
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN ecn enable
@TotalLag
TotalLag / crawl.sh
Last active September 3, 2021 11:30
modified to warm up cloudflare cache
#!/bin/bash
# warmly.sh
# A wget based, easy, poor man`s cache warmer script
# https://gist.github.com/thomasfr/7926314
# The MIT License (MIT)
#
# Copyright (c) 2013,2014 Thomas Fritz <fritztho@gmail.com> (http://fritzthomas.com)
#
@TotalLag
TotalLag / sandboxie.ini
Created February 15, 2022 03:43
Sandboxie config for Steam
[GlobalSettings]
FileRootPath=\??\%SystemDrive%\Sandbox\%USER%\%SANDBOX%
SeparateUserFolders=y
KeyRootPath=\REGISTRY\USER\Sandbox_%USER%_%SANDBOX%
IpcRootPath=\Sandbox\%USER%\%SANDBOX%\Session_%SESSION%
NetworkEnableWFP=n
EditAdminOnly=y
ForceDisableAdminOnly=n
ForgetPassword=n
Template=WindowsRasMan
@TotalLag
TotalLag / ascii
Created April 2, 2022 21:23
Valorant Crosshair
================================================================================
================================================================================
================================================================================
================================================================================
================================================================================
=================================------------:==================================
==============================---:==========:---================================
==============================---:===:--:===:---================================
==============================---:====--====:---================================
==============================----==========:---================================