Skip to content

Instantly share code, notes, and snippets.

@satokjp
satokjp / header.c
Last active December 20, 2015 07:59
PDP-11 a.out binary C Mac
/*
cc header.c -o header
*/
#include <stdio.h>
#include <stdint.h>
uint8_t mem[0x10000];
/**************************************************/
@satokjp
satokjp / gist:6097613
Last active December 20, 2015 07:59
PDP-11 binary F# Mono Xamarin Mac
open System.IO
open System.Text
let mem = Array.zeroCreate<byte>(0x10000)
mem.[0] <- 0x10uy
mem.[1] <- byte 0x20
printfn "0:%d %02x" mem.[0] mem.[0]
printfn "1:%d %02x" mem.[1] mem.[1]
@satokjp
satokjp / runrun.c
Last active December 20, 2015 14:49
x86 a.out binary C mac
/*
Compile : cc runrun.c -o runrun
Execute : ./runrun a.out -> run mode
./runrun -d a.out -> disassemble mode (not run)
*/
/*
usage: 7run [-p] [-d|-v/-s] cmd [args ...]
-p: PDP-11 mode
-8: 8086/V6 mode
-d: disassemble mode (not run)
Dim strTmp,regTmp
strTmp = "/a/bb/ccc/file.txt"
Set regTmp = New RegExp
regTmp.Pattern = "(^\/.*\/)([^\/]+\.\w+$)"
Set matches = regTmp.Execute(strTmp)
@satokjp
satokjp / test.java
Last active December 25, 2015 18:19
java test program
//
// test.java
// Compile: javac test.java
// Run: java test -t/-b [file name]
//
// env LC_ALL=en javac test.java :mac
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
@satokjp
satokjp / run.java
Last active December 26, 2015 07:38
//
// run.java
// Compile: javac run.java
// env LC_ALL=en javac run.java mac
// javac -J-Dfile.encoding=UTF-8 run.java mac
// Run: java run [file name] -> run mode
// java run -d [file name] -> disassemble mode
//
/*
@satokjp
satokjp / test_sftp.tcl
Created March 28, 2014 06:42
expect sftp sample script
#!/usr/bin/expect
# for cygwin64
#
puts "start"
#spawn ping 192.168.1.101
spawn sftp [email protected]
expect "password: "
send "usr-passwd\n"
@satokjp
satokjp / test_ssh.tcl
Created March 28, 2014 06:46
expect ssh sample script
#!/usr/bin/expect --
# for cygwin64 Windows
#
# timeout sec
#set timeout 10
set timeout -1
# HOST & ID
set HOST "[email protected]"
@satokjp
satokjp / .bashrc
Last active August 29, 2015 13:57
# alias
alias ll='ls -l'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias h=history
PATH="$PATH":~/sh:~/bin
@satokjp
satokjp / set_time.sh
Created April 3, 2014 07:40
set time
#!/usr/bin/bash
#
if [ $# -ne 1 ]; then
echo
echo "command line error!"
echo "Usage: $0 [IP_Address]"
exit 1
fi
DATE=`date +"%m/%d %k:%M:%S %Y"`