Skip to content

Instantly share code, notes, and snippets.

extern crate zip;
use zip::write::FileOptions;
fn main() {
let path = std::path::Path::new("dummy.zip");
let file = std::fs::File::create(&path).unwrap();
let mut zip = zip::ZipWriter::new(file);
@Yasushi
Yasushi / main.fs
Created September 27, 2017 04:36
decode chrome login data
module Main
open System
open System.Security.Cryptography
open System.Text.RegularExpressions
let fromHex (s:string) =
s
|> Seq.windowed 2
|> Seq.mapi (fun i j -> (i,j))
import java.io._
import com.googlecode.sardine.SardineFactory
import scala.util.control.Exception._
object Main extends App {
val log = new PrintWriter("output", "UTF-8")
@Yasushi
Yasushi / bootlocal.sh
Last active March 28, 2019 00:49
boot2docker static ip
#!/bin/sh
kill `cat /var/run/udhcpc.eth0.pid`
ifconfig eth0 192.168.0.100 netmask 255.255.255.0 up
ip route add default via 172.168.0.1 dev eth0
echo nameserver 8.8.8.8 >> /etc/resolv.conf
#/mnt/sda1/var/lib/boot2docker/bootlocal.sh
@Yasushi
Yasushi / settings.json
Created September 26, 2017 01:37
vs code settings
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Source Han Code JP M, Consolas, 'Courier New', monospace",
"editor.fontSize": 13,
"window.zoomLevel": 1,
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\6.0.0.14\\powershell.exe",
"workbench.colorTheme": "Quiet Light",
"typescript.referencesCodeLens.enabled": false,
"workbench.editor.enablePreview": false
}
@Yasushi
Yasushi / fonts.clj
Created September 25, 2017 08:39
print available fonts clojure
(import java.awt.GraphicsEnvironment)
(def ge (GraphicsEnvironment/getLocalGraphicsEnvironment))
;;(def fs (.getAllFonts ge))
;;(dorun (->> fs (map #(.getName %)) sort (map println)))
(dorun (->> ge .getAvailableFontFamilyNames sort (map println)))
(apply 'concat (mapcar 'capitalize (split-string (or \2 "") "_")))
get-eventlog system | ? { $_.EventID -eq 13 } | select -first 3 | fl
javascript:if(location.href.match(/\/(dp|product|ASIN)\/([^\/]+)/)){location.href=%22http://www.amazon.co.jp/dp/%22+RegExp.$2}
cd ~/.emacs.d/elpa
/Applications/Emacs.app/Contents/MacOS/Emacs *(/P:-L:) -q -batch --eval '(progn (load "package") (setq byte-compile-verbose t) (batch-byte-recompile-directory 0))'