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
# -*- coding: utf-8 -*- | |
from fabric.api import task | |
from fabric.api import env | |
# コマンドラインから`stage.production`ではなく`production`と指定できるように関数をインポートする | |
from stage import production, integration, staging, testing, development | |
import myapp # アプリケーションごとにモジュールをわける | |
# import myapp2 |
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 ubuntu | |
RUN apt-get update && apt-get install -y dpkg-dev | |
RUN echo "#!/bin/sh \n\ | |
set -eu \n\ | |
CMD_PATH=\$(which \$1) \n\ | |
PACKAGE=\$(dpkg --search \$CMD_PATH | cut -d ':' -f 1 | sed 's/\s//g') \n\ | |
echo \$1 in \$PACKAGE \n\ | |
apt-get source \$PACKAGE \n\ |
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
--- | |
- hosts: all | |
connection: local | |
gather_facts: no | |
sudo: no | |
vars: | |
# インベントリに指定するディレクトリでステージごとにファイルを切り替える。他にもinventory_hostnameやgroup_nameなどのマジック変数を利用してファイルを切り替える。 | |
- decrypted: "{{ lookup('pipe', 'ansible-vault view --vault-password-file=/path/to/password/file /path/to/secret/{{ inventory_dir | default(\".\", true) | basename }}/file') }}" | |
tasks: | |
- debug: > |
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
use std::process::Command; | |
fn prepare_cmd(cmd: &str, args: &[&str]) -> Command { | |
let mut cmd = Command::new(cmd); | |
for arg in args { | |
cmd.arg(arg); | |
} | |
cmd | |
} |
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
extern crate libc; | |
use libc::pid_t; | |
fn pid() -> pid_t { | |
unsafe { libc::getpid() } | |
} | |
fn main() { | |
println!("{}", pid()); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlueColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NIMCAw | |
LjIgMQAQAYAC0hAREhNaJGNsYXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2Jq | |
ZWN0XxAPTlNLZXllZEFyY2hpdmVy0RcYVHJvb3SAAQgRGiMtMjc7QUhOW2JrbW90f4iQ |
Rustを30分で紹介する(訳) - uehaj's blogのコードをRust 1.9.0で書いてみました。
よくわからない😇
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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 perl | |
use Mojolicious::Lite; | |
app->hook(before_dispatch => sub { | |
my $c = shift; | |
# Mojo::Message::Requestのdefault_charsetを指定することで、 | |
# 自動的に指定された文字エンコーディングでパラメータがデコードされる(デフォルトはUTF-8)。 | |
$c->req->default_charset('cp932'); | |
}); |