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
let x = | |
for c in [1..100] do | |
match c%3,c%5 with | |
| 0,0 -> printfn "FizzBuzz" | |
| 0,_ -> printfn "Fizz" | |
| _,0 -> printfn "Buzz" | |
| _ -> printfn "%d" c |
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
# diff -u /usr/src/sys/amd64/conf/GENERIC.hints /boot/device.hints | |
--- /usr/src/sys/amd64/conf/GENERIC.hints 2016-09-29 08:24:54.000000000 +0900 | |
+++ /boot/device.hints 2016-12-11 00:43:23.415251000 +0900 | |
@@ -19,7 +19,6 @@ | |
hint.uart.0.port="0x3F8" | |
hint.uart.0.flags="0x10" | |
hint.uart.0.irq="4" | |
-hint.uart.1.at="isa" | |
hint.uart.1.port="0x2F8" | |
hint.uart.1.irq="3" |
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 child_process = require('child_process'); | |
exports.handler = function(event, context) { | |
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' }); | |
proc.on('close', function(code){ | |
if(code !== 0) { | |
return context.done(new Error("Process exited with non-zero status code")); | |
} |
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
FROM debian:squeeze | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update \ | |
&& apt-get install -y wget \ | |
&& wget -O - http://packages.vyos.net/vyos-pubkey.gpg | apt-key add - \ | |
&& echo "deb http://backports.debian.org/debian-backports squeeze-backports main" > /etc/apt/sources.list.d/bp.list \ | |
&& apt-get update \ | |
&& apt-get -t squeeze-backports install -y squashfs-tools \ |
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/sh | |
# | |
# Shell script that configures gnome-terminal to use solarized theme | |
# colors. Written for Ubuntu 11.10, untested on anything else. | |
# | |
# Solarized theme: http://ethanschoonover.com/solarized | |
# | |
# Adapted from these sources: | |
# https://gist.github.com/1280177 | |
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/ |
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
# knife cheat | |
## Search Examples | |
knife search "name:ip*" | |
knife search "platform:ubuntu*" | |
knife search "platform:*" -a macaddress | |
knife search "platform:ubuntu*" -a uptime | |
knife search "platform:ubuntu*" -a virtualization.system | |
knife search "platform:ubuntu*" -a network.default_gateway |
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/sh | |
# Print four lines showing blocks of colors: 0-7 | 0-7bold | 8-15 | 8-15bold | |
perl -CADS -lwe ' | |
my $block = shift || (chr(0x2588) x 3); | |
for (["", 0], ["1;", 0], ["", 8], ["1;", 8]) { | |
my ($bold, $offset) = @$_; | |
my @range = map $offset + $_, 0..7; | |
printf "%s %-6s ", $bold ? "bold" : "norm", "$range[0]-$range[-1]"; | |
print map("\e[${bold}38;5;${_}m$block", @range), "\e[0m" | |
} |
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
# BitWarden tool to delete collections using bw CLI tool | |
# forked from: https://gist.github.com/eduncan911/c0f4d789b87c3746a055779a57ff57e5 | |
# uses subprocess to run bw commands rather than sh which is Linux only | |
# You must install the bitwarden CLI tool (https://bitwarden.com/help/article/cli/#download-and-install) | |
# Create your session as per the instructions on the download page. | |
# You can replace your session key and use the following to process the results. | |
# place this script in the same dir as the bw executable |
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 csvdata | |
// csvdata complements the csv package by allowing you to map a custom structure to | |
// the columns of data in a CSV file. The struct needs to be annotated so that each | |
// field can match a column in the data | |
// | |
// type Person struct { | |
// FirstName string `field:"First Name"` | |
// Second_Name string | |
// Age int | |
// } |
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
FROM plexinc/pms-docker:1.22.3.4523-d0ce30438 | |
RUN apt-get update && \ | |
apt-get install -y software-properties-common && \ | |
add-apt-repository ppa:oibaf/graphics-drivers -y && \ | |
apt-get update && \ | |
apt-get install -y \ | |
vainfo \ | |
mesa-va-drivers \ | |
mesa-vdpau-drivers \ |
OlderNewer