Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# https://github.com/Nyr/wireguard-install
#
# Copyright (c) 2020 Nyr. Released under the MIT License.
# Detect Debian users running the script with "sh" instead of bash
if readlink /proc/$$/exe | grep -q "dash"; then
echo 'This installer needs to be run with "bash", not "sh".'
@sukum
sukum / install.sh
Last active August 28, 2024 06:35
[ladder installation] ladder install and config #ladder #proxy #config #install
sudo apt install libc-ares2 libmbedtls14 libpcre3 libev4
# I think above is for shadowsocks and might not be needed for ladder
@sukum
sukum / proxmox-proxy
Created October 5, 2022 18:14 — forked from basoro/proxmox-proxy
Running Proxmox behind a single IP address
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables.
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding.
Network configuration
Here’s how it’s done:
Create a virtual interface that serves as the gateway for your VMs:
@sukum
sukum / switch_user.php
Last active April 23, 2021 15:21 — forked from karlingen/switch_user.php
SugarCRM user switching / login as another user
<?php
if (!defined('sugarEntry')) {
define('sugarEntry', true);
}
require_once('include/entryPoint.php');
require_once 'include/MVC/SugarApplication.php';
$app = new SugarApplication();
$app->startSession();
$app->loadUser();
@sukum
sukum / tmux_cheatsheet.markdown
Last active October 24, 2019 12:56 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@sukum
sukum / mwan-config.sh
Created September 9, 2019 14:11 — forked from braian87b/mwan-config.sh
/etc/config/mwan
# My documentation:
#
# Important: this works well on OpenWRT 15.05.1, on newer versions there was some breaking changes, for example, the wan ifaces have ipv6 capability and now are named with letters ("wan, wanb... , wanc" instead of "wan, wan2... wan3" so wanb6 means 2nd wan ipv6.): https://github.com/openwrt/packages/blob/master/net/mwan3/files/etc/config/mwan3
#
# We have Interfaces, Members, Policyes y Rules:
#
# Interfaces: Allows to identify the wan interface, we just need to have it enabled`
# the others parameters are only to track if the interface it is up or down.
#
# Members: Can be defined in some metric and weight, both values will be important ambos when used in policyes.
@sukum
sukum / start-stop-example.sh
Last active October 16, 2019 00:51 — forked from alobato/start-stop-example.sh
[start-stop-example] #linux #service #shell #debian
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=foo
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/usr/local/bin/bar
@sukum
sukum / backup.php
Last active June 25, 2016 07:49 — forked from toddsby/backup.php
backup.php
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
* contribution: Drew Toddsby
* contribution: sukum, http://stackoverflow.com/questions/15369291/how-to-ignore-directories-using-recursiveiteratoriterator
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
/* Creates an alert pop-up with the message 'Foo' */
YAHOO.SUGAR.MessageBox.show({msg: 'Foo'} );
/* Creates an alert pop-up with the message 'Foo' and title 'Bar' */
YAHOO.SUGAR.MessageBox.show({msg: 'Foo', title: 'Bar'} );
/* Creates a confirm pop-up with the message 'Foo' and title 'Bar' that does a particular action on callback based upon the button clicked */
YAHOO.SUGAR.MessageBox.show({msg: 'Foo', title: 'Bar', type: 'confirm',
fn: function(confirm) {
if (confirm == 'yes') {
//do something if 'Yes' was clicked
}
@sukum
sukum / OpportunitiesForCaseLink.php
Last active October 30, 2015 06:53 — forked from dranney-sugarcrm/OpportunitiesForCaseLink.php
Create the basic Link2 override class