Discover gists
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
git clean -xfd | |
git submodule foreach --recursive git clean -xfd | |
git reset --hard | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive |
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 java.io.IOException; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.FileChannel; | |
import java.nio.file.FileSystems; | |
import java.nio.file.StandardOpenOption; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.Provider; | |
import java.security.SecureRandom; |
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
HANGMANPICS = [''' | |
+---+ | |
| | | |
| | |
| | |
| | |
| | |
=========''', ''' | |
+---+ |
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
#!/bin/sh | |
#------------------------------------------------------------------------------ | |
# Configuration. | |
#------------------------------------------------------------------------------ | |
#========================================================================================= | |
#===================================== Initial firewall configuration ========================== | |
#========================================================================================= | |
#This is the network interface for the internet |
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
version: "3" | |
services: | |
# configuration manager for NiFi | |
zookeeper: | |
hostname: myzookeeper | |
container_name: zookeeper_container_persistent | |
image: 'bitnami/zookeeper:3.7.0' # latest image as of 2021-11-09. | |
restart: on-failure | |
environment: | |
- ALLOW_ANONYMOUS_LOGIN=yes |
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
virt-install \ | |
--boot uefi \ | |
--cdrom /var/lib/libvirt/images/Windows.iso \ | |
--features vmport.state=off,hyperv.vapic.state=on,hyperv.spinlocks.state=on,hyperv.spinlocks.retries=8191,hyperv.relaxed.state=on \ | |
--clock offset=localtime,hypervclock_present=yes,rtc_tickpolicy=catchup,hpet_present=no,pit_tickpolicy=delay \ | |
--machine q35 \ | |
--vcpus 2 \ | |
--cpu host \ | |
--graphics spice \ | |
--sound ich9 \ |
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
""" | |
This is an example which uses the "low-level" interface, specifying | |
the indexes or slices() that should be transformed one into | |
another. | |
""" | |
class Test(Scene): | |
def construct(self): | |
m1 = MathTex(r"\frac{x}{y} = \frac{a}{b}\times5") | |
self.add(m1) | |
m2 = MathTex(r"x\cdot b = y\cdot a\times5") |
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
""" | |
Convert YouTube subtitles(vtt) to human readable text. | |
Download only subtitles from YouTube with youtube-dl: | |
youtube-dl --skip-download --convert-subs vtt <video_url> | |
Note that default subtitle format provided by YouTube is ass, which is hard | |
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which | |
is easier to process. |
NewerOlder