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
package main | |
import ( | |
"fmt" | |
"bytes" | |
"text/template" | |
) | |
type Person struct { | |
Name string |
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
#!/bin/bash | |
read -s -p "New Password: " password | |
echo | |
read -s -p "Re-enter new Password: " confirm | |
echo | |
if [ "$password" != "$confirm" ]; then | |
echo "Password don't match!" | |
exit 1 | |
fi |
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/node | |
var args = process.argv; | |
if (args.length < 3) { | |
console.log("Usage: " + args[1] + " <text file>"); | |
process.exit(1); | |
} | |
fs = require('fs'); | |
fs.readFile(args[2], function(err, data) { |
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
var time = require("./time.js"); | |
time.now({callback: function(msg) { | |
console.log("This will be printed to irc:"); | |
console.log(msg); | |
}}); |
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
# * * * * * command to be executed | |
# ┬ ┬ ┬ ┬ ┬ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ └───── day of week (0 - 7) (0 or 7 are Sunday, or use names) | |
# │ │ │ └────────── month (1 - 12) | |
# │ │ └─────────────── day of month (1 - 31) | |
# │ └──────────────────── hour (0 - 23) | |
# └───────────────────────── min (0 - 59) |
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#define MB 1000 * 1000 | |
#define GB 1000 * MB |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#define CMD_OFFSET 2 | |
#define MAX_CMD_LENGTH 2048 | |
int strlen_total(char **str, int length) { |
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
WAN addr: 81.167.4.214 | |
eth0 = LAN | |
$ ipv6calc --action 6rd_local_prefix --6rd_prefix 2a01:79c::/30 --6rd_relay_prefix 213.167.115.92/0 81.167.4.214 | |
2a01:79d:469c:1358::/62 | |
sudo ip tunnel add 6rdtun mode sit local 81.167.4.214 ttl 64 | |
sudo ip tunnel 6rd dev 6rdtun 6rd-prefix 2a01:79c::/30 | |
sudo ip link set 6rdtun 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
# Set ctrl-a as prefix | |
set -g prefix C-a | |
unbind C-b | |
# ctrl-a passthrough by sending ctrl-a 2 times | |
bind C-a send-prefix | |
# Less delay | |
set -sg escape-time 1 |
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
postApiR :: Handler () | |
postApiR = do | |
liftIO $ putStrLn "init" | |
payload <- requireJsonBody :: Handler Payload | |
now <- liftIO getCurrentTime | |
_ <- runDB $ insert $ Weather now (temperature payload) (humidity payload) | |
sendResponseStatus status201 ("CREATED" :: Text) |
OlderNewer