Skip to content

Instantly share code, notes, and snippets.

@jakelee8
jakelee8 / tweaks.md
Last active July 12, 2023 06:44
Linux performance tweaks

Linux performance tweaks

All commands are run as root.

Enable swap file

Create the swap file using either of these commands. fallocate is faster but may not work on all filesystems.

fallocate -l 32G /swap/swap0
@ryankearney
ryankearney / ComcastInject.html
Last active June 10, 2023 14:40
This is the code Comcast is injecting into its users web traffic.
<script language="JavaScript" type="text/javascript">
// Comcast Cable Communications, LLC Proprietary. Copyright 2012.
// Intended use is to display browser notifications for critical and time sensitive alerts.
var SYS_URL='/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do';
// var image_url='http://servicealerts.comcast.net:8080/images/mt';
var image_url='http://xfinity.comcast.net/constantguard/BotAssistance/notice/images';
var headertext1='<strong>Comcast Courtesy Notice</strong>';
var textline1='You have reached 90% of your <b>monthly data usage allowance</b>.';
var textline2='Please sign in for more information and to remove this alert.';
var acknowledgebutton='<a href=\"#\" onClick="document.location.href=\''+SYS_URL+'?dispatch=redirect&redirectName=login&paramName=bmUid\'" title="Sign in to acknowledge" style="color: #FFFFFF;"><img alt="Sign in to acknowledge" src="'+image_url+'/mt_signin.png"/></a>';
#!/bin/sh
# strict mode: error if commands fail or if unset variables are used
set -eu
if [ "$#" -lt 2 ]
then
echo Usage: `basename $0` "<limit> <command>..."
echo or: `basename $0` "<memlimit> -s <swaplimit> <command>..."
exit 1
@gerarldlee
gerarldlee / Installing Kali Linux as a Windows 10 Subsystem for Linux
Created January 21, 2018 01:15
Installing Kali Linux as a Windows 10 Subsystem for Linux
Installing Kali Linux as a Windows 10 Subsystem for Linux
Powershell (Admin)
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
lxrun /install
git clone https://github.com/RoliSoft/WSL-Distribution-Switcher.git
cd WSL-Distribution-Switcher
python get-prebuilt.py kalilinux/kali-linux-docker
@adamlacombe
adamlacombe / multiple-xlsx-to-single-csv.sh
Created December 17, 2020 23:18
Convert multiple xlsx files to csv files then merge multiple csv files into one
#!/bin/bash
# https://stackoverflow.com/a/21651707/9238321
for i in *.xlsx; do libreoffice --headless --convert-to csv "$i" ; done
# https://unix.stackexchange.com/a/558965
awk '(NR == 1) || (FNR > 1)' *.csv > all.csv
@snaptopixel
snaptopixel / decorator.ts
Created January 29, 2019 17:04
Stencil custom decorator example
/*
* @Component()
* class ThemedComponent {
* @Inject() theme: ITheme;
* }
*/
const theme = {foo: 'bar'};
export function Inject() {
@ekandreas
ekandreas / pull.php
Last active March 10, 2018 11:54
PHP Deployer, Pull script example from production to my local Bedrock/Vagrant environment
<?php
/**
* Pull script example from production to my local Bedrock/Vagrant environment
* Requires PHP Deployer 3
*
* Andreas Ek, 2015-04-23
*/
date_default_timezone_set( 'Europe/Stockholm' );