Skip to content

Instantly share code, notes, and snippets.

View ickc's full-sized avatar
💭
I may be slow to respond.

Kolen Cheung ickc

💭
I may be slow to respond.
View GitHub Profile
[
{
"AcceptedWhileDraining": false,
"Activity": "Idle",
"AddressV1": "{[ p=\"primary\"; a=\"195.194.108.111\"; port=9618; n=\"Internet\"; alias=\"wn1905340.in.tier2.hep.manchester.ac.uk\"; spid=\"startd_1985_1f95\"; noUDP=true; ], [ p=\"IPv4\"; a=\"195.194.108.111\"; port=9618; n=\"Internet\"; alias=\"wn1905340.in.tier2.hep.manchester.ac.uk\"; spid=\"startd_1985_1f95\"; noUDP=true; ], [ p=\"IPv6\"; a=\"2001:630:22:d0ff:b226:28ff:fe53:a12a\"; port=9618; n=\"Internet\"; alias=\"wn1905340.in.tier2.hep.manchester.ac.uk\"; spid=\"startd_1985_1f95\"; noUDP=true; ]}",
"Arch": "X86_64",
"AuthenticatedIdentity": "condor_pool@in.tier2.hep.manchester.ac.uk",
"AuthenticationMethod": "PASSWORD",
"CanHibernate": true,
"ChildAccountingGroup": [
name: py310
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- alabaster=0.7.13=pyhd8ed1ab_0
- alsa-lib=1.2.8=h166bdaf_0
- anyio=3.6.2=pyhd8ed1ab_0
@ickc
ickc / udp_hole_punch_tester.py
Last active July 5, 2023 18:39 — forked from somic/udp_hole_punch_tester.py
UDP Hole Punching test tool
#!/usr/bin/env python
#
# udp_hole_punch_tester.py - UDP Hole Punching test tool
#
# Usage: udp_hole_punch_tester.py remote_host remote_port
#
# Run this script simultaneously on 2 hosts to test if they can punch
# a UDP hole to each other.
#
# * remote_port should be identical on 2 hosts.
set exportFolder to (choose folder) as string
-- Simple text replacing
on replaceText(find, replace, subject)
set prevTIDs to text item delimiters of AppleScript
set text item delimiters of AppleScript to find
set subject to text items of subject
set text item delimiters of AppleScript to replace
set subject to "" & subject
@ickc
ickc / mosh-at-NERSC.md
Last active December 20, 2023 23:47
Using mosh at NERSC

Mosh is a replacement for interactive SSH terminals. It's more robust and responsive, especially over Wi-Fi, cellular, and long-distance links. from Mosh: the mobile shell

Preparation

mosh-server

You need your host to have mosh-server. So you need to

  1. install it
  2. made it discoverable at login stage
@ickc
ickc / base_2018_plikHM_TTTEEE_lowl_lowE_lensing_cl_lensed.dat
Last active February 10, 2021 19:07
base_2018_plikHM_TTTEEE_lowl_lowE_lensing_cl_lensed.dat
This file has been truncated, but you can view the full file.
# total lensed [l(l+1)/2pi] C_l's (units: [microK]^2)
# for l=2 to 4902, i.e. number of multipoles equal to 4901
#
# -> if you don't want to see such a header, set 'headers' to 'no' in input file
# -> for CMB lensing (d), these are C_l^dd for the deflection field.
# -> for galaxy lensing (lens[i]), these are C_l^phi-phi for the lensing potential.
# Remember the conversion factors:
# C_l^dd (deflection) = l(l+1) C_l^phi-phi
# C_l^gg (shear/convergence) = 1/4 (l(l+1))^2 C_l^phi-phi
#
@ickc
ickc / YAML-speed-test.ipynb
Last active December 19, 2020 01:06
Test various YAML load speed
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ickc
ickc / vscode-update.txt
Created March 31, 2020 02:08
Some urls to get vscode URLs
https://update.code.visualstudio.com/api/releases/insider
https://update.code.visualstudio.com/api/releases/stable
https://update.code.visualstudio.com/api/update/darwin/insider/VERSION
https://update.code.visualstudio.com/api/update/server-linux-x64/insider/VERSION
https://update.code.visualstudio.com/api/update/linux-deb-x64/insider/VERSION
#!/usr/bin/env bash
# usage DRYRUN=1 ./rm-colormunki-photo.sh
# c.f. https://xritephoto.com/ph_product_overview.aspx?ID=2458&Action=Support&SupportID=5932
# not all Logs will not be deleted
if [[ -n "$DRYRUN" ]]; then
rmxrite=echo
else
rmxrite='sudo rm -rf'