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:
@cvuorinen
cvuorinen / karma.conf.js
Last active October 19, 2020 13:03
Example configurations for running Karma & Protractor tests in headless Chrome (see http://cvuorinen.net/2017/05/running-angular-tests-in-headless-chrome/)
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
anonymous
anonymous / minprj-react-flow
Created May 30, 2016 11:13
#!/usr/bin/env sh
mkdir $1
cd $1
npm init -y
npm install -D babelify watchify babel-preset-es2015 babel-preset-react babel-plugin-syntax-flow babel-plugin-transform-flow-strip-types react react-dom
echo '{"presets": ["es2015", "react"], "plugins": ["transform-flow-strip-types", "syntax-flow"]}' > .babelrc
gibo Node OSX > .gitignore
cat <<EOF > .flowconfig
[ignore]
@watagashi
watagashi / data.json
Last active December 17, 2015 13:28 — forked from mid0111/data.json
javascript の ループ内での同期
[
{"name": "静岡市立番町小学校", "address": "静岡市葵区新富町一丁目 23 番地の 1", "tel": "054-253-2148"},
{"name": "静岡市立新通小学校", "address": "静岡市葵区駒形通二丁目 4 番 47 号", "tel": "054-252-1301"},
{"name": "静岡市立駒形小学校", "address": "静岡市葵区南安倍二丁目 1 番 1 号", "tel": "054-252-3340"},
{"name": "静岡市立安西小学校", "address": "静岡市葵区安西一丁目 96 番地の 3", "tel": "054-271-1551"},
{"name": "静岡市立田町小学校", "address": "静岡市葵区田町五丁目 70 番地", "tel": "054-255-3428"},
{"name": "静岡市立井宮小学校", "address": "静岡市葵区平和一丁目 7 番 1 号", "tel": "054-271-5288"},
{"name": "静岡市立井宮北小学校", "address": "静岡市葵区上伝馬 2 番 1 号", "tel": "054-272-1326"},
{"name": "静岡市立安倍口小学校", "address": "静岡市葵区安倍口新田 50 番地", "tel": "054-296-0005"},
{"name": "静岡市立美和小学校", "address": "静岡市葵区遠藤新田 69 番地の 1", "tel": "054-296-0700"},
@indieisaconcept
indieisaconcept / gist:936dbf33cfc844d87968
Last active February 2, 2023 19:58
browserify + watchify + viny-transform + multiple bundles
// this setup assumes you are using gulp-config for file.src & file.dest
// but can be adapted to vanilla easily.
'use strict';
var transform = require('vinyl-transform'),
browserify = require('browserify'),
watchify = require('watchify'),
// consider using gulp-load-plugins
@udzura
udzura / tutorial.md
Created June 2, 2014 03:31
Hubot + CoffeeScript ではじめるやわらかプログラミング入門

やわらかプログラミング入門

  • Hubot であそぼう


始めに、地図を描く

@taichi
taichi / configure_bower.md
Created September 2, 2013 06:50
bowerにbowerrcを使ってプロキシの設定をする

bowerにプロキシの設定をする方法

プロジェクトのディレクトリかユーザホームディレクトリに.bowerrcファイルを作る。

  • Windowsのユーザホームの確認の仕方
> echo %HOMEPATH%
@kitak
kitak / doc.md
Last active October 18, 2023 09:57
コマンドによる「負荷」の原因切り分け

コマンドによる「負荷」の原因切り分け

この文章では、Linuxコマンド、sar, top, psを使って、一般的に負荷といわれるものの原因を切り分けることを目的とする。

そもそも負荷とは

「複数のタスクによるサーバリソースの奪い合いの結果に生じる待ち時間」を一言で表した言葉。OSのチューニングとは負荷の原因を知り、それを取り除くことにほかならない。

ボトルネックの見極め作業の大まかな流れ

  • ロードアベレージ(処理を実行したくても、実行できなくて待たされているプロセス(CPUの実行権限が与えられるのを待っている、またはディスクI/Oが完了するのを待っている)の数)を見る
@KidA78
KidA78 / gist:5279210
Created March 31, 2013 02:19
Some code to help engineers mock Twitter4J using EasyMock
import java.util.ArrayList;
import java.util.List;
import org.easymock.EasyMock;
import org.easymock.IExpectationSetters;
import org.json.JSONArray;
import org.json.JSONObject;
import twitter4j.Paging;
import twitter4j.RateLimitStatus;

componentについて

componentはWebアプリ向けのパッケージ管理システムです。 componentではGithubのリポジトリをパッケージとして扱います。

例えば、ボタンをクリックすると"Hello, world!"を表示するような簡単なアプリをかいてみます。

component createコマンドでプロジェクトを作成します。 今回はGithub上に配置する予定は無いので--localオプションをつけています。

$ component create --local hello-world