Skip to content

Instantly share code, notes, and snippets.

View fxrcode's full-sized avatar
🎯
Leetcoding

fxrc fxrcode

🎯
Leetcoding
  • Gopher
  • The net is vast and infinite
View GitHub Profile
'''
9 9
[(0, 0, 3), (0, 2, 5), (0, 2, 7)]
3
'''
def google_count_sqr(M):
"""[summary]
XXX: Calculate cumulative sums by rows and by columns
Then loop all left-upper corner and possible square len to check ALL-4 side len
@fxrcode
fxrcode / 1-liner.md
Last active October 6, 2020 05:04
collections of useful 1 liners
@fxrcode
fxrcode / genca.sh
Last active May 24, 2019 23:36 — forked from wsargent/genca.sh
Generate a certificate authority and trust anchor keystore, using only keytool
#!/bin/bash
export PW=`cat password`
# Create a self signed key pair root CA certificate.
keytool -genkeypair -v \
-alias rootca \
-dname "CN=rootca, OU=Example Org, O=Example Company, L=San Francisco, ST=California, C=US" \
-keystore rootca.jks \
-keypass:env PW \
# https://cloud.google.com/iot/docs/how-tos/credentials/keys
openssl req -x509 -nodes -newkey rsa:2048 -keyout rsa_private.pem \
-days 1000000 -out rsa_cert.pem -subj "/CN=unused"
# This command generate certificate with private key, so I can build jwt in jwt.io.
# Also, I can use the certificate(x5c) as publicKey in JWKS for testing.
@fxrcode
fxrcode / collections.md
Created December 21, 2018 19:27
interesting collections with url
@fxrcode
fxrcode / make-cuda-openmpi.log
Created April 25, 2018 18:08
log of making openmpi with cuda-aware
Making install in monitoring
make[2]: Entering directory '/home/p1/openmpi-3.0.1/test/monitoring'
make[3]: Entering directory '/home/p1/openmpi-3.0.1/test/monitoring'
make[3]: Nothing to be done for 'install-data-am'.
/bin/mkdir -p '/usr/local/lib'
/bin/bash ../../libtool --mode=install /usr/bin/install -c monitoring_prof.la '/usr/local/lib'
libtool: warning: relinking 'monitoring_prof.la'
libtool: install: (cd /home/p1/openmpi-3.0.1/test/monitoring; /bin/bash "/home/p1/openmpi-3.0.1/libtool" --silent --tag CC --mode=relink gcc -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -pthread -module -avoid-version -shared -o monitoring_prof.la -rpath /usr/local/lib monitoring_prof.lo ../../ompi/libmpi.la ../../opal/libopen-pal.la -lrt -lm -lutil -lz )
libtool: install: /usr/bin/install -c .libs/monitoring_prof.soT /usr/local/lib/monitoring_prof.so
libtool: install: /usr/bin/install -c .libs/monitoring_prof.lai /usr/local/lib/monitoring_prof.la
@fxrcode
fxrcode / .zshrc
Created March 20, 2018 18:27
Mar20_2018 oh my zsh
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
pip
kubectl completion zsh
docker
docker-compose
@fxrcode
fxrcode / grub.log
Last active May 23, 2017 18:16
KVM-QEMU GPU passthrough
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
@fxrcode
fxrcode / caffe-jupyter.log
Created May 17, 2017 17:39
docker caffe with Jupyter
130 p1@p1-xos:~⟫ sudo nvidia-docker run -ti -p 8888:8888 bvlc/caffe:gpu /bin/bash
root@5842b6adba3a:/workspace# pip install jupyter
Collecting jupyter
Downloading jupyter-1.0.0-py2.py3-none-any.whl
Collecting ipykernel (from jupyter)
Downloading ipykernel-4.6.1-py2-none-any.whl (104kB)
100% |################################| 112kB 4.0MB/s
Collecting jupyter-console (from jupyter)
Downloading jupyter_console-5.1.0-py2.py3-none-any.whl
Collecting qtconsole (from jupyter)