As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/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".' |
| sudo apt install libc-ares2 libmbedtls14 libpcre3 libev4 | |
| # I think above is for shadowsocks and might not be needed for ladder |
| 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: |
| <?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(); |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| # 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. |
| #!/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 |
| <?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 | |
| } |
| <?php | |
| //custom/modules/Cases/OpportunitiesForCaseLink.php | |
| class OpportunitiesForCaseLink extends Link2 { | |
| protected $db; | |
| public function __construct($linkName, $bean, $linkDef = false) | |
| { | |
| $this->focus = $bean; | |
| $this->name = $linkName; | |
| $this->db = DBManagerFactory::getInstance(); | |
| if (empty($linkDef)) { |