Skip to content

Instantly share code, notes, and snippets.

@dentechy
dentechy / WSL-ssh-server.md
Last active March 30, 2024 16:16
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@ftclausen
ftclausen / Jenkinsfile
Created April 13, 2017 05:36
Jenkins pipeline - An approach to get all commits since the last successful build.
// -*- mode: groovy -*-
// vim: set filetype=groovy :
node( 'some_node' ) {
stage( "Phase 1" ) {
sshagent( credentials: [ 'some_creds' ] ) {
checkout scm
def lastSuccessfulCommit = getLastSuccessfulCommit()
def currentCommit = commitHashForBuild( currentBuild.rawBuild )
if (lastSuccessfulCommit) {
@jim3ma
jim3ma / http_proxy.go
Created January 25, 2017 02:11
Register Dialer Type for HTTP&HTTPS Proxy in golang
package main
import (
"bufio"
"fmt"
"net"
"net/http"
"net/url"
"crypto/tls"
@perguth
perguth / .htaccess
Last active January 28, 2024 19:01
Apache reverse proxy `.htaccess` file eg. for NodeJS. @Uberspace
SetEnvIf Request_URI "^(.*)" PORT=65300
RewriteEngine On
RewriteBase /
# CORS
Header add Access-Control-Allow-Origin "*"
# HTTPS
RewriteCond %{HTTPS} !=on
@cvuorinen
cvuorinen / autocomplete.js
Last active March 24, 2018 22:11
RxJS & Angular 1 Autocomplete example
angular.module('app', ['rx'])
.directive('autocomplete', function () {
return {
scope: {},
template: '<input ng-model="val" ng-change="update(val)" />' +
'<ul class="suggestions">' +
'<li ng-repeat="suggestion in suggestions">' +
'<a href="https://github.com/{{ suggestion }}"' +
' target="_blank">{{ suggestion }}</a>' +
'</li>' +
@evantoli
evantoli / GitConfigHttpProxy.md
Last active April 26, 2024 17:21
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@marcinwol
marcinwol / setup_proxychains-ng.sh
Last active November 9, 2023 15:54
Setup and test proxychains-ng on Ubuntu 14.04
# if you havent done it yet, please download the tor-browser and start it
# https://www.torproject.org/download/download-easy.html.en
wget https://www.torproject.org/dist/torbrowser/5.0/tor-browser-linux64-5.0_en-US.tar.xz
tar xf tor-browser-linux64-5.0_en-US.tar.xz
# download the source of proxychains-ng
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
@harlow
harlow / golang_job_queue.md
Last active April 24, 2024 10:21
Job queues in Golang
@davidfowl
davidfowl / dotnetlayout.md
Last active May 3, 2024 08:40
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@crynobone
crynobone / install-oci8.sh
Last active October 4, 2019 18:26
Provision Oracle InstantClient for Ubuntu Vagrant.
#!/usr/bin/env bash
export LD_LIBRARY_PATH=/opt/oracle/instantclient
export ORACLE_HOME=/opt/oracle/instantclient
echo "Instantclient path: instantclient,/opt/oracle/instantclient"
sudo pecl install oci8
sudo echo "extension=oci8.so" >> /etc/php5/fpm/php.ini