Skip to content

Instantly share code, notes, and snippets.

@tachesimazzoca
tachesimazzoca / REAME.md
Last active June 21, 2020 03:06
How to setup Rakuten (LTE) SIM for Surface Go LTE

How to setup Rakuten (LTE) SIM for Surface Go LTE

Motivation

This week, I made a contruct for a nano SIM card of Rakuten Mobile UN-LIMIT.

I tried installing the SIM to my Surface Go LTE, but unfortunatelly the easy first attempt failed.

@tachesimazzoca
tachesimazzoca / README.md
Last active May 13, 2019 13:22
Mail Cheat Sheet
public class IOUtils {
public static String toString(InputStream input, String charset) throws IOException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int n = 0;
while ((n = input.read(buffer)) != -1) {
output.write(buffer, 0, n);
}
return output.toString(charset);
}
@tachesimazzoca
tachesimazzoca / install-go-pkgs.sh
Last active January 23, 2019 11:29
Visual Studio Code Settings
#!/bin/sh
set -e
go get -u -v github.com/mdempsky/gocode
go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs
go get -u -v github.com/ramya-rao-a/go-outline
go get -u -v github.com/acroca/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v golang.org/x/tools/cmd/gorename
@tachesimazzoca
tachesimazzoca / README.md
Created October 28, 2018 16:31
Ubuntu Cheat Sheet

Ubuntu Cheat Sheet

iptables

$ sudo iptables -S
...
$ sudo iptables -P FORWARD ACCEPT
@tachesimazzoca
tachesimazzoca / README.md
Created August 21, 2018 02:41
Diagnostic Tools in Java

Diagnostic Tools in Java

jcmd

# The following error occurs when the pid owned by the diffrent user.
$ jcmd <pid> help
<pid>:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
        at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
@tachesimazzoca
tachesimazzoca / monoid.scala
Last active May 5, 2018 00:22
Type Classes in Scala
trait Semigroup[A] {
def combine(a: A, b: A): A
}
trait Monoid[A] extends Semigroup[A] {
def empty: A
}
object Monoid {
def apply[A : Monoid]: Monoid[A] = implicitly[Monoid[A]]
@tachesimazzoca
tachesimazzoca / README.md
Last active June 11, 2017 03:50
Using JIS Keyboard as US Keyboard on XKB

Using JIS Keyboard as US Keyboard on XKB

The command setxkbmap allows us to modify any key mapppings in user X session. However each time the input method is changed, the modified states will be reset. Since I have no clue to solve this problem, I decided to rewrite the global symbol file at my own risk.

$ cp /usr/share/X11/xkb/symbols/jp /path/to/backup/jp.default
$ patch -u /usr/share/X11/xkb/symbols/jp < js-ansi.patch

Before editing xkb resources, I highly recommend that you save the current keymap. Just save the original keymap and restore it.