Skip to content

Instantly share code, notes, and snippets.

@imwower
imwower / openssh-7.3.sh
Created October 12, 2018 14:21 — forked from stefansundin/openssh-7.3.sh
Install OpenSSH 7.3 in Ubuntu 16.04
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
wget https://launchpadlibrarian.net/277739251/openssh-client_7.3p1-1_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
@imwower
imwower / readme.md
Created October 12, 2018 02:44 — forked from techgaun/readme.md
OpenSSH 7.4 on Ubuntu 16.04

Installing OpenSSH 7.4 on Ubuntu 16.04

sudo apt install -y build-essential libssl-dev zlib1g-dev
wget "http://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/openssh-7.4p1.tar.gz"
tar xfz openssh-7.4p1.tar.gz
cd openssh-7.4p1
./configure
make
sudo make install
@imwower
imwower / cleanup.sh
Created October 11, 2018 16:04 — forked from superseb/cleanup.sh
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@imwower
imwower / nginx.yaml
Created September 13, 2018 09:25
nginx.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
field.cattle.io/creatorId: user-2xdrm
creationTimestamp: null
generation: 1
labels:
workload.user.cattle.io/workloadselector: deployment-base-nginx
@imwower
imwower / jenkins.yaml
Created September 13, 2018 07:41
jenkins.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "6"
field.cattle.io/creatorId: user-2xdrm
field.cattle.io/publicEndpoints: '[{"nodeName":"c-zd4f7:m-948a94211766","addresses":["10.40.20.216"],"port":8080,"protocol":"TCP","podName":"base:jenkins-84d69d7-fvfk2","allNodes":false}]'
creationTimestamp: null
generation: 1
labels:
@imwower
imwower / README.md
Created September 11, 2018 10:15 — forked from superseb/README.md
Generate self signed certificates for Rancher 2.0

Generate self signed certificates for Rancher 2.0

Generate certificates

docker run -v $PWD/certs:/certs \
  -e SSL_SUBJECT=test.example.com \
  -e SSL_DNS=test.example.com,test2.example.com \
  -e SSL_IP=10.0.0.1 \
  -e K8S_SAVE_CA_CRT=true \
@imwower
imwower / ClassFinder.java
Created March 10, 2017 10:39
java class finder with jar package
public class ClassFinder {
private static final char PKG_SEPARATOR = '.';
private static final char DIR_SEPARATOR = '/';
private static final String CLASS_FILE_SUFFIX = ".class";
private static final String BAD_PACKAGE_ERROR = "Unable to get resources from path '%s'. Are you sure the package '%s' exists?";
private static Logger logger = Logger.getLogger(ClassFinder.class);
/**
* scannedPackage: com.foo.bar
*
@imwower
imwower / ngrokd.sh
Created February 16, 2017 07:20
auto start ngrokd script on centos, put this script to /etc/init.d/ngrokd
#!/usr/bin/env bash
# These setting need you to set.
LOCATION=/usr/local/src/ngrok/bin
TLSKEY=/usr/local/src/ngrok/bin/device.key
TLSCRT=/usr/local/src/ngrok/bin/device.crt
DOMAIN=ngrok.domain.com
PORT=8000
HTTPSPORT=4443
LOGFILE=/usr/local/src/ngrok/bin/logs/ngrokd.log
PIDFILE=/usr/local/src/ngrok/bin/run/ngrokd.pid
@imwower
imwower / HttpClient.java
Last active January 3, 2017 02:57
java使用apache http client发送get和post请求;支持文件上传和ssl
package com;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
@imwower
imwower / StateHelper
Created September 25, 2014 08:08
visual state manager helper
{
/// <summary>
/// Copied from http://stackoverflow.com/questions/6002046/binding-visualstatemanager-view-state-to-a-mvvm-viewmodel
/// </summary>
public class StateHelper : DependencyObject
{
public static readonly DependencyProperty StateProperty = DependencyProperty.RegisterAttached(
"State", typeof(String), typeof(StateHelper), new PropertyMetadata("Normal", StateChanged));