Skip to content

Instantly share code, notes, and snippets.

@irwincong
irwincong / ios_cli_netconfig.md
Last active September 22, 2023 19:53
ios cli network config get and set

Although iOS (and macOS) is based on a flavor of nix, changing the network settings from the command line is not as simple as executing ifconfig. Changing system wide persistent proxy settings, for example, is not done by modifying a file.

System Configuration Utility

To persist network configuration changes, use the Apple scutil cli tool (see man scutil).

@irwincong
irwincong / kaiu.ttf
Last active January 31, 2022 15:31
kaiu.ttf
This file has been truncated, but you can view the full file.

Keybase proof

I hereby claim:

  • I am irwincong on github.
  • I am irwincong (https://keybase.io/irwincong) on keybase.
  • I have a public key whose fingerprint is FE62 0964 1907 818A EF2C 75DD 2EB4 1F59 5BA0 928A

To claim this, I am signing this object:

@irwincong
irwincong / random_linked_list.c
Created August 31, 2020 06:07
Initial and untested solution for "copy linked list with random pointer" from https://www.youtube.com/watch?v=Y189fjNEMWU
/* Analysis:
- Storage is O(1)
- Time is O(2*N)
Post-morten after looking up alternate solutions:
* https://www.geeksforgeeks.org/clone-linked-list-next-random-pointer-o1-space/
- new list is created interleaved with old nodes
- first pass creates the new nodes and a second pass is used to disconnect the old and new lists
- next pointers of the original node is clobbered and then restored -- a better solution than mine
- Time complexity is the same as mine. Space complexity is slightly better than mine.
#!/usr/bin/env python3
# DATE: 2020.08.08
# Initial attempt at solving https://web.archive.org/save/https://techdevguide.withgoogle.com/resources/coding-question-minesweeper
# NOTE: Untested
"""
# Initial impressions
*Task:*
- Construct the playing field given the size [of the field] and a number of mines.
*Questions:*
#!/usr/bin/env python3
# DATE: 2020.08.08
# My initial solution for:
# https://web.archive.org/web/20200618185144/https://techdevguide.withgoogle.com/resources/compress-decompression/
#
# Time complexity: O(length of input string).
# Storage complexity: I think my storage complexity is related to recursion (stack) depth and string length.
# I don't recall how python passes strings, but I hope it is passed by reference instead of by value.
# If by reference, then I think I have a O(length of input string)
@irwincong
irwincong / philips_hue_firmware_api_notes.md
Last active November 16, 2024 00:05
Finding the Philips Hue Firmware Download API

Philips Hue Firmware Download API discovery

Laste Update: Fri 05 Jun 2020 02:22:05 PM UTC

Easy Way

With hardware, you could intercept traffic.

Hard(er) Way

  1. Download APK