cat /proc/sys/net/bridge/bridge-nf-call-iptablessysctl vm.swappiness=0
swapoff -a| function enableContextMenu(aggressive = true) { | |
| void (document.ondragstart = null); | |
| void (document.onselectstart = null); | |
| void (document.onclick = null); | |
| void (document.onmousedown = null); | |
| void (document.onmouseup = null); | |
| void (document.body.oncontextmenu = null); | |
| enableRightClickLight(document); | |
| if (aggressive) { | |
| enableRightClick(document); |
| $startTime = date("Y-m-d H:i:s"); | |
| //display the starting time | |
| echo 'Starting Time: '.$startTime; | |
| //add 1 hour to time | |
| $cenvertedTime = date('Y-m-d H:i:s',strtotime('+1 hour',strtotime($startTime))); | |
| //display the converted time | |
| echo 'Converted Time (added 1 hour): '.$cenvertedTime; |
| # Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads | |
| import os | |
| from optparse import OptionParser | |
| from selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options | |
| CHROME_PATH = '/usr/bin/google-chrome' |
| <!-- Example #1 - no styling --> | |
| Made with ❤ in Switzerland | |
| Made with ♥ in Switzerland | |
| Made with ♡ in Switzerland | |
| Made with ❤️ in Switzerland | |
| Made with ♥️ in Switzerland | |
| <!-- Example #2 - inline-styled ❤ --> | |
| Made with <span style="color: #e25555;">♥</span> in Switzerland | |
| Made with <span style="color: #e25555;">♥</span> in Switzerland |
Picking the right architecture = Picking the right battles + Managing trade-offs
Make Sandstorm and other web server coexist in the same port while keeping HTTPS encryption.
The purpose of this tutorial is to set up SNI Proxy so it’s possible to use Sandstorm verified SSL encryption while coexisting with another web server that also uses SSL.
The main reason is to allow other users to connect with your Sandstorm instance in the standard HTTPS port (443) and keep using that port also for any other web apps.
| ################################################################# | |
| # = This script transfers bash history to zsh history | |
| # = Change bash and zsh history files, if you don't use defaults | |
| # | |
| # = Usage: ruby bash_to_zsh_history.rb | |
| # | |
| # = Author: Ankit Goyal | |
| ################################################################# | |
| # change if you don't use default values |
| from django import forms | |
| from django.core import validators | |
| from django.core.exceptions import ValidationError | |
| class MinLengthValidator(validators.MinLengthValidator): | |
| message = 'Ensure this value has at least %(limit_value)d elements (it has %(show_value)d).' | |
| class MaxLengthValidator(validators.MaxLengthValidator): | |
| message = 'Ensure this value has at most %(limit_value)d elements (it has %(show_value)d).' |
My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.
To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)
Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.