Skip to content

Instantly share code, notes, and snippets.

@radekg
radekg / fix-xcode-select-error-xcodebuild-requires-xcode.md
Created October 3, 2022 13:49 — forked from berkedel/fix-xcode-select-error-xcodebuild-requires-xcode.md
Fix `xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance`

Tried to create react app

npx create-react-app app

Unfortunately, got an xcodebuild error

node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.17/fse-v1.0.17-node-v57-darwin-x64.tar.gz
@radekg
radekg / README.md
Created November 30, 2021 02:01 — forked from nmarley/README.md
Go / C++ bindings example

Go / C++ bindings example

This is an example of Go code calling to a C++ library with a C wrapper.

Build

go build  # this only ensures it compiles
@radekg
radekg / Certificates.go
Created March 24, 2021 23:47 — forked from Mattemagikern/Certificates.go
Create x509 certificate chain using Golang. Root CA, Designated CA, server CA
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
@radekg
radekg / cloud.cfg
Created March 21, 2021 02:37 — forked from imduffy15/cloud.cfg
Cloud-init config example for using the none data source provider to setup a box for usage with vagrant on finding no cloud metadata service.
disable_ec2_metadata: True
datasource_list: [ "ConfigDrive", "None"]
datasource:
None:
userdata_raw: |
#!/bin/bash
groupadd vagrant
useradd -d /home/vagrant -s /bin/bash -m -g vagrant -G wheel vagrant
echo "root:vagrant" | chpasswd
@radekg
radekg / my_app.sh
Last active August 29, 2015 14:24 — forked from guillermo/my_app.sh
#!/bin/bash
# This is a unix wrapper around the erlang vm. It provides the following functionality:
#
# * Spawns in foreground
# * Handle SIGHUP and call RELOADFUNC
# * Handle SIGTERM SIGQUIT and SIGINT telling to the vm to quit
# * Dies if the vm dies (for example kernel killing because out of memory)
#
# Forks and improvements are welcome.

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

# ================================================================================
# ObjectStorageUploader.sh
# © Copyright IBM Corporation 2014.
# LICENSE: MIT (http://opensource.org/licenses/MIT)
# ================================================================================
import argparse
import os
import math
import http.client

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: