wg genkey | tee my_private | wg pubkey > my_public # both for Client and Server
ip link add wg0 type wireguard
ip addr add 192.168.2.2/24 dev wg0
wg set wg0 private-key ./my_private # server's private key
ip link set wg0 up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mix.install([ | |
{:nx, "~> 0.1.0"}, | |
]) | |
input = """ | |
13 26 9 44 | |
2 14 6 23 | |
14 20 3 28 | |
23 25 9 60 | |
13 24 8 42 | |
1 12 2 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
# Aliases | |
alias g='git' | |
#compdef g=git | |
alias gst='git status' | |
#compdef _git gst=git-status | |
alias gd='git diff' | |
#compdef _git gd=git-diff | |
alias gdc='git diff --cached' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `a` ( | |
`id` INT(100) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`userid` VARCHAR(11) DEFAULT NULL, | |
`subject` VARCHAR(11) DEFAULT NULL, | |
`score` INT(11) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=INNODB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; | |
INSERT INTO `a` (`id`, `userid`, `subject`, `score`) | |
VALUES |
response = RestClient.post "http://api.sendcloud.net/apiv2/mail/send", :attachments => File.new('all.sql','rb'),:apiUser => 'metalist',:apiKey => 'key',:from => "leslie_wen@qq.com",:fromName => "noname",:to => "leslie_wen@qq.com",:subject => "users assets",:html => 'users assets: attachments'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
function check_result() { | |
return fs.existsSync('foo.txt'); | |
} | |
function* infiniteSequence() { | |
let num = 1 | |
while (true) { | |
yield num |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Ex where | |
newtype Flip f a b = | |
Flip (f b a) | |
deriving (Eq, Show) | |
newtype K a b = | |
K a | |
deriving (Eq, Show) | |
instance Functor (Flip K a) where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './mysql-connector-java-5.1.47-bin.jar' | |
require "rubygems" | |
require "java" | |
require "csv" | |
begin | |
# Prep the connection | |
Java::com.mysql.jdbc.Driver | |
userurl = "jdbc:mysql://10.52.3.224:3306/market" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'cocoa' | |
Cocoa::NSAutoreleasePool.new | |
app = Cocoa::NSApplication.sharedApplication | |
app.setActivationPolicy Cocoa::NSApplicationActivationPolicyRegular | |
app.activateIgnoringOtherApps true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(server1). | |
-export([start/2, rpc/2]). | |
start(Name, Mod) -> | |
register(Name, spawn(fun() -> loop(Name, Mod, Mod:init()) end)). | |
rpc(Name, Request) -> | |
io:format(" self at rpc is ~p~n", [self()]), | |
io:format(" Name at rpc is ~p~n", [Name]), | |
Name ! { self(), Request }, |
NewerOlder