Skip to content

Instantly share code, notes, and snippets.

norio-nomura / Setup transparent proxy with VMware
Last active Jun 16, 2021
Setup transparent proxy with VMware Fusion
View Setup transparent proxy with VMware

Setup transparent proxy with VMware Fusion

  1. Add network (vmnet3) to VMware Fusion
    1. sudo vi /Library/Preferences/VMware\ Fusion/networking
       answer VNET_1_HOSTONLY_SUBNET
       answer VNET_1_VIRTUAL_ADAPTER yes
      +answer VNET_3_DHCP yes
      +answer VNET_3_DHCP_PARAM_DNS_ADDR
norio-nomura / setExcludedFromBackupToCaches.swift
Created Nov 20, 2014
View setExcludedFromBackupToCaches.swift
#!/usr/bin/env xcrun swift
import Cocoa
extension NSURL {
var isDirectory: Bool {
return resourceValue(NSURLIsDirectoryKey)
var isExcludedFromBackup: Bool {
return resourceValue(NSURLIsExcludedFromBackupKey)
norio-nomura / How I stream from iPad to Twitch and
Last active Nov 20, 2020
How I stream from iPad to Twitch and Ustream.
View How I stream from iPad to Twitch and

How I stream from iPad to Twitch and Ustream.

I'm broadcasting my iPad game playing on and

I'm using following hardwares.

  • Playing Game: iPad 3 w/ iOS 7.1.2
  • Broadcasting to Twitch: MacBook Air Mid 2011 w/ OS X 10.9

I'm using following softwares on Mac.

norio-nomura / config.console
Last active Oct 26, 2020
`git commit` 時に自動でPGP署名する設定
View config.console
git config user.signingkey <secret key id>
git config gpg.program /path/to/
git config commit.gpgsign true
View gist:d0909148e5271ddb94ea0e9cfb31b45f
TruAnon Verification Key: 7atz5gnfvbms3dljtyokfguqha - I am using TruAnon to verify Github.
norio-nomura /
Last active Sep 16, 2019
[Xcode 11] Building Yams using `xcodebuild` without `.xcodeproj` with `-destination "name=iPhone 8"`
15:27:26 git clone
Cloning into 'Yams'...
remote: Enumerating objects: 111, done.
remote: Counting objects: 100% (111/111), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 3987 (delta 58), reused 71 (delta 31), pack-reused 3876
Receiving objects: 100% (3987/3987), 4.24 MiB | 1.85 MiB/s, done.
Resolving deltas: 100% (2313/2313), done.
15:27:43 cd Yams
15:27:46 git:(master) rm -rf Yams.xcodeproj
norio-nomura / ClassExistencial.asm
Created Aug 2, 2019
swiftc -emit-assembly ClassExistencial.swift|swift demangle>ClassExistencial.asm
View ClassExistencial.asm
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 10, 15 sdk_version 10, 15
.globl _main
.p2align 4, 0x90
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
norio-nomura /
Created Oct 5, 2018
dns-sd(1)を使い、VMware Fusionのホスト側NATインターフェイス(を`host.docker.internal.local`としてアドバタイズする
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
View httpBodyIsNotSentToTheDomainThatReceivedCookie.swift
import Dispatch
import Foundation
var setCookieRequest = URLRequest(url: URL(string: "")!)
let setCookieTask = URLSession.shared.dataTask(with: setCookieRequest) { _, _, error in
guard error == nil else { fatalError("failed to set cookie!") }
var request = URLRequest(url: URL(string: "")!)
request.httpMethod = "POST"
request.httpBody = "{\"key\":\"value\"}".data(using: .utf8)
norio-nomura /
Last active Aug 26, 2018
How to use `thread backtrace -e true` in `lldb`.
$ echo 'import Dispatch; func f() {}; .default).async { f() }; dispatchMain()'|swiftc -
$ lldb
(lldb) target create main
Current executable set to 'main' (x86_64).
(lldb) b f
Breakpoint 1: 9 locations.
(lldb) process launch -v DYLD_LIBRARY_PATH=/usr/lib/system/introspection -v DYLD_INSERT_LIBRARIES=/Applications/
Process 33297 launched: '/Users/norio/github/swift-dev/SourceKitten/main' (x86_64)
Process 33297 stopped
* thread #2, queue = '', stop reason = breakpoint 1.1