Skip to content

Instantly share code, notes, and snippets.

View james-see's full-sized avatar
🍀
make your own luck

JC james-see

🍀
make your own luck
View GitHub Profile
@james-see
james-see / killallofme.sh
Created September 13, 2023 14:17
one liner to kill a list of pattern matching processes, in this example selenium
sudo ps -ef | grep selenium | cut -d\ -f4 | xargs kill -9;
@james-see
james-see / recruiter-auto-response.md
Created September 4, 2023 03:12
recruiter response template

Thanks so much for reaching out. I'm always interested in hearing about what new and exciting opportunities are out there. As a software engineer I'm sure you can imagine that I get a very high volume of recruiters reaching out on LinkedIn. It is a wonderful position of privilege to be in and I'm thankful for it. It does however mean that I don't have the time to hop on a call with everyone who reaches out. A lot of the time, incoming messages represent a very poor fit indeed. I would love to continue the conversation, but before I do, I'd like to level set around the level of seniority that you're looking for. Can you send along the company name, a job description and, total compensation details for the role you're reaching out in reference to?

While I very much appreciate the fact that exceptionally talented and engaged recruiters reach out consistently, sorting serious and high quality opportunities from spam would be a full time job without an autoresponder. In the absence of detailed information rega

@james-see
james-see / gist:5b414e249e6ed552e4ee7c75b6b0a8af
Last active August 29, 2023 02:56
fast way to create a 1000000 digit number
import sys
import multiprocessing
import math
sys.set_int_max_str_digits(10000000)
def worker_function(dummy_arg):
"""Function to calculate 10**100000 and return its length."""
result = 10**1000000
return result
@james-see
james-see / multiprime.py
Created August 22, 2023 22:32
multiprocessing example python prime factorization
import multiprocessing
def is_prime(n):
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
@james-see
james-see / chunky.py
Created June 2, 2023 03:28
chunk and split up a large json array into smaller
import json
with open('ru2.json') as infile:
o = json.load(infile)
chunkSize = 1000
for i in range(0, len(o), chunkSize):
with open('output/file_' + str(i//chunkSize) + '.json.txt', 'w') as outfile:
json.dump(o[i:i+chunkSize], outfile)
@james-see
james-see / gist:d309d48017380b57987ce0042223e9ea
Last active December 5, 2023 17:25
behavior-interview-questions.txt
1. Give me a 5-10 min background on your experience
- ensures we have the right-ish candidate for role and guage overall personality fit
2. What drives you / excites you about / has been your favorite thing about your career so far
- can judge interest, experience, role fit, and growth opportunities to ensure retention if they are right for role
3. What has been challenging in the past / negative experiences and why
- red flags come out sometimes or yellow flags or insight into how they learn and take criticism or deal with difficult situations
4. We care about work/life balance, what do you do outside of work?
@james-see
james-see / convoy.sh
Created April 23, 2023 19:28
download package dependancies and get them ready to deploy offline
#!/bin/bash
# Convoy downloads the stuff you need per package name for debian/ubuntu
# Requirements: dpkg-dev
# Example: ./convoy.sh python3-pip
get list of dependancies and download
sudo apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances "$1" | grep "^\w" | sort -u)
# create necessary Packages.gz file
sudo dpkg-scanpackages . | gzip -9c > Packages.gz
# gzipped all of it and ready
tar czvf convoyed.tar.gz .
<!DOCTYPE html>
<head>
<style>
body {
background: rgb(0, 0, 0);
overflow: hidden;
font-family: "Times", serif;
margin: 5px;
}
@james-see
james-see / gpggithub.sh
Created December 15, 2022 15:57
doing gpg right with github
$ brew install gnupg
$ gpg --full-generate-key --expert
# Select ECC (sign only)
# Select Curve 25519
# Use 0 for key does not expire
# Use your real name
# Importantly, for GitHub.com verified GPG commit signitures you MUST use
# an email address associated with your GitHub.com account. Unless you enjoy
# spam you should likely use GitHub's "no-reply" email feature documented at
#!/bin/bash
# vars
VPNIP=127.0.0.1
# base
sudo ufw default deny outgoing
sudo ufw default deny incoming
sudo ufw allow ssh
sudo ufw reload
# github
sudo ufw allow to 185.199.108.0/22