Skip to content

Instantly share code, notes, and snippets.

Issue

Encountered an error when running dev_appserver.py .: File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 336, in start raise BindError('Unable to find a consistent port for %s' % host) google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to find a consistent port for localhost Exception in thread Thread-1 (most likely raised during interpreter shutdown):

Solution (sort of...)

Attempted following steps:

  1. python -m SimpleHTTPServer server starts on port 8000, works fine
interface Immu { String getA() ; String getB ( ) }
Immu immu ( final String a , final String b )
{
/* validation of a and b */
return new Immu ( )
{
public String getA ( ) { return a ; }
public String getB ( ) { return b ; }
@zfwf
zfwf / polyglot-python.cmd
Created January 29, 2017 23:21
polyglot to run python in windows batch
@SETLOCAL ENABLEDELAYEDEXPANSION & CALL "%~f0" & (IF NOT ERRORLEVEL 1 (python -x "%~f0" %*) ELSE (ECHO No python environment found on path)) & PAUSE & EXIT /B !ERRORLEVEL!
#%0 is the command itself. So %~f0 expands to the full path of the batch file. %* stands for all command line parameters except %0.
#do something in python
@zfwf
zfwf / dell-touchpad-fix-xps-precision.md
Last active April 11, 2017 10:46
Dell XPS13/XPS15/Precision E5520/ touchpad fix

from: https://ubuntuforums.org/showthread.php?t=2327954&p=13505497#post13505497
Change syndaemon settings to: syndaemon -i 1.0 -KRd
Unfortunately this cannot be set on startup as of 16.04: https://bugs.launchpad.net/ubuntu/+source/unity-settings-daemon/+bug/1351772
Use after logon to activate: pkill syndaemon; syndaemon -i 1.0 -KRd

from: https://ubuntuforums.org/showthread.php?t=2316240&p=13461233#post13461233
add below entry to: /usr/share/X11/xorg.conf.d/51-synaptics-quirks.conf

# Disable generic Synaptics device, as we're using
# "DLL0704:01 06CB:76AE Touchpad"
@zfwf
zfwf / enable-super-key-dell-oem
Created March 27, 2017 01:28
enable super key on Dell OEM machine
http://www.dell.com/support/article/us/en/04/HOW12108/how-to-enable-the-ubuntu-super-key-on-dell-oem-ubuntu-installations
@zfwf
zfwf / dell-sysinfo.sh
Last active May 27, 2017 11:05
Dell system info
sudo dmidecode -s system-serial-number
sudo dmidecode -s bios-version
sudo dmidecode -s bios-release-date
@zfwf
zfwf / browser-events.md
Created September 5, 2017 22:57
browser events

Mosly from Kirupa's "Running Your code at the Right Time" link, quick, more

Basic order
  1. HTML is downloaded and parsing starts
  2. Each element is parsed, styles registered, script executed (inline or external)
  3. When entire DOM is parsed, document.DOMContentLoaded event fires, in JQuery this is the $(document).ready(), shorthand "($function() {})"
  4. When DOM and assets (including parsing of all CSS and JS) is complete, window.load event fires
Few things to note:
  1. Loading of JS blocks DOM parsing
@zfwf
zfwf / tm-cmds.md
Last active March 10, 2020 03:34
Terminal commands to learn

tmux

  • tmux new -s <name> create new session with
  • tmux attach -t <name> attach to session with
  • tmux kill-session -t <name> kill session with

In tmux hit prefix c-a or c-b then:

? to see a list of commands
Sessions

:new new session

@zfwf
zfwf / chrome-remote-desktop.patch
Created February 9, 2018 08:40 — forked from YusukeIwaki/chrome-remote-desktop.patch
chrome-remote-desktopをdisplay 0表示するように改造するための修正ポイント
diff --git a/chrome-remote-desktop.orig b/chrome-remote-desktop
index a40063b..de1b3b0 100755
--- a/chrome-remote-desktop.orig
+++ b/chrome-remote-desktop
@@ -66,11 +66,11 @@ XORG_DUMMY_VIDEO_RAM = 1048576 # KiB
# with large or multiple monitors. This is a comma-separated list of
# resolutions that will be made available if the X server supports RANDR. These
# defaults can be overridden in ~/.profile.
-DEFAULT_SIZES = "1600x1200,3840x2560"
+DEFAULT_SIZES = "1920x1080"
@zfwf
zfwf / gist:64695924cb0941089f8163e73cfad209
Last active December 29, 2022 03:58
ubuntu openvpn configs
# Client configs, 16.04,
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
# network manager, 16.04, install below package to enable import openvpn client configs
sudo apt install network-manager-openvpn-gnome
# Client configs, 18.04/18.10