View a.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /var/log/dnscrypt-proxy/query.log | awk '{print $4}' | sort | uniq -c | sort | egrep '\.[^.]*\.[a-z]*$' --color=auto |
View ffmpeg_metadata.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg \ | |
-map_metadata -1 \ | |
-metadata title=<STR> \ | |
-acodec copy \ | |
-vcodec copy \ | |
-map 0:0 \ | |
-map 0:1 \ | |
-i <FILE> \ | |
<STR> |
View win-on-chromeos.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon virt-manager -y |
View golden_ratio.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turtle | |
def fib(): | |
i, j = 0, 1 | |
yield i | |
while True: | |
i, j = j, i + j | |
yield i |
View Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
USER root | |
WORKDIR /root | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update -y \ | |
&& apt-get install -y --no-install-recommends \ | |
gcc \ |
View GD transfer to GCS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.colab import drive | |
drive.mount('/content/drive') | |
from google.colab import auth | |
auth.authenticate_user() | |
project_id = 'initbar' | |
!gcloud config set project {project_id} | |
!gsutil ls | |
bucket_name = 'work.init.bar' |
View fowler-noll-vo.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function | |
import base64 | |
import struct | |
def fnv64(data): | |
hash_ = 0xcbf29ce484222325 | |
for b in data: | |
hash_ *= 0x100000001b3 | |
hash_ &= 0xffffffffffffffff |
View test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import pprint | |
import random | |
import numpy | |
class RandomPixelsDist(object): | |
def __init__(self, width=10, height=10, density=0.8): | |
self.width = width |
View puzzle-solution-1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MIT License | |
# | |
# Copyright (c) 2019 Herbert Shin | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
View analyze-urandom.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from bashplotlib.histogram import plot_hist | |
from bashplotlib.scatterplot import plot_scatter | |
from os import urandom | |
import os | |
import time | |
if __name__ == '__main__': |
NewerOlder