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/python | |
# encoding: UTF-8 | |
import os,sys | |
import random | |
class babanuki: | |
allcards="A234567890JQK"*4+"X" | |
normcard="A234567890JQK" | |
cardtypes=normcard+"X" |
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
define :iptables_open_tcp, :port => -1 do | |
if params[:port]>0 then | |
bash "iptables-#{params[:port]}" do | |
code <<-EOH | |
sed -i.bak -e '/--dport 22/a\-A INPUT -m state --state NEW -m tcp -p tcp --dport #{params[:port]} -j ACCEPT' /etc/sysconfig/iptables | |
EOH | |
not_if "grep -q -- \"--dport #{params[:port]} \" /etc/sysconfig/iptables" | |
end | |
service "iptables-restart-#{params[:port]}" do | |
service_name "iptables" |
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
boxes = [ | |
["host1", "192.168.3.2"], | |
["host2", "192.168.3.3"], | |
] | |
Vagrant.configure("2") do |config| | |
config.vm.box = "cent65" | |
config.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.1/centos65-x86_64-20131205.box" | |
if Vagrant.has_plugin?("vagrant-cachier") | |
config.cache.auto_detect=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
#! /bin/sh | |
CC=${CC-gcc} | |
lang=${lang-c} | |
incfs=() | |
structs=() | |
for i; do | |
if [ -f "$i" ] ; then | |
incfs+=("$i") |
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 ( | |
"encoding/json" | |
"io" | |
"log" | |
"os" | |
"reflect" | |
"strings" | |
"unicode" |
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
--- s3fs-fuse-1.78/configure.ac.orig 2014-09-15 22:30:51.000000000 +0900 | |
+++ s3fs-fuse-1.78/configure.ac 2014-12-30 20:27:36.000000000 +0900 | |
@@ -156,13 +156,13 @@ dnl | |
dnl For PKG_CONFIG before checking nss/gnutls. | |
dnl this is redundant checking, but we need checking before following. | |
dnl | |
-PKG_CHECK_MODULES([common_lib_checking], [fuse >= 2.8.4 libcurl >= 7.0 libxml-2.0 >= 2.6]) | |
+PKG_CHECK_MODULES([common_lib_checking], [osxfuse >= 2.7.3 libcurl >= 7.0 libxml-2.0 >= 2.6]) | |
AC_MSG_CHECKING([compile s3fs with]) |
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 ( | |
"bitbucket.org/tebeka/strftime" | |
"io" | |
"log" | |
"os" | |
"os/exec" | |
"strings" | |
"time" |
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 | |
for i; do | |
#awk '{print;}/move to next layer/{ly=$(NF);gsub("[()]","",ly);print ";LAYER:"ly;}' ${i} > ${i}.new | |
awk 'BEGIN{ly=0;}{print;}/^G1 Z/{ly++;print ";LAYER:"ly;}' ${i} > ${i}.new | |
if cmp ${i} ${i}.new > /dev/null ; then | |
rm ${i}.new | |
else | |
mv $i ${i}.bak | |
mv ${i}.new ${i} |
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
// Usage: $0 srcdir dstdir | |
// TODO: keep timestamp: os.Chtimes(name, atime, mtime) | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"os" |
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
version: '3' | |
services: | |
gogs: | |
container_name: gogs | |
image: gogs/gogs | |
ports: | |
- 3000:3000 | |
volumes: | |
- ./gogs:/data |
OlderNewer