Skip to content

Instantly share code, notes, and snippets.

@xsephiroth
xsephiroth / reset-trial-navicat.sh
Created March 5, 2024 01:02 — forked from nakamuraos/reset-trial-navicat.sh
Reset trial Navicat 15, Navicat 16 on Linux
#!/bin/bash
# Author: NakamuraOS
# https://github.com/nakamuraos
# Latest update: 30/03/2022
# Tested on Navicat 15.x, 16.x on Linux
RED="\e[1;31m"
ENDCOLOR="\e[0m"
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
broker:
image: confluentinc/cp-kafka:latest
@xsephiroth
xsephiroth / virtualboxInstall.md
Created October 9, 2020 02:04
Fix VirtualBox’s “Kernel Driver Not Installed (rc=-1908)"

vboxmanage extpack install --replace {EXTPACKFILE}

@xsephiroth
xsephiroth / Dockerfile
Created August 19, 2020 02:51
docker run JetBrains GUI
FROM ubuntu:18.04
RUN apt update && apt install default-jdk -y
@xsephiroth
xsephiroth / docker.sh
Last active May 20, 2020 04:35
duboku m3u8 download script
#!/bin/bash
docker run --rm -it \
-v /tmp/out:/out \
jrottenberg/ffmpeg:4.1-alpine \
-user_agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3554.0 Safari/537.36" \
-headers "origin: https://www.fanstui.com" \
-headers "referer: https://www.fanstui.com/static/player/videojs.html" \
-i xxx.m3u8 \
-c copy /out/v.mp4
@xsephiroth
xsephiroth / .vimrc
Created March 27, 2020 09:28
.vimrc
" jsx [insert]<Tab>: auto complete html tag
" div
" <div></div>
autocmd BufNewFile,BufRead *.js,*.jsx inoremap <Tab> <Esc>^i<<Esc>$a><Esc>^v$y$pbi/<Esc>h
" jsx [normal]/!: to self close tag
" <div>abc</div>
" <div />abc
autocmd BufNewFile,BufRead *.js,*.jsx nnoremap /! ^f>i /<Esc>f<vf>xF
@xsephiroth
xsephiroth / hooks.js
Last active February 19, 2020 07:31
React CRA service worker update demo
// setup check service worker manually update interval
const useUpdatePwaServiceWorker = (interval=60 * 1000) => {
useEffect(() => {
const update = () => {
const sw = window.navigator.serviceWorker;
sw && sw.getRegistrations()
.then(rs => rs.forEach(r => r.update()))
.catch(console.error);
};
@xsephiroth
xsephiroth / consumer.sh
Created November 21, 2019 13:27
gstreamer rtp vp8
gst-launch-1.0 udpsrc port=9001 ! application/x-rtp, clock-rate=90000, media=video, encoding-name=VP8 ! rtpvp8depay ! vp8dec ! autovideosink
@xsephiroth
xsephiroth / traefik.swarmMode.notoml.yml
Last active July 12, 2021 11:11
traefik docker swarm example
# without traefik.toml config file
# use docker service command
version: "3.7"
services:
reverse-proxy:
image: traefik:1.7
networks:
- traefiknet
@xsephiroth
xsephiroth / index.html
Created December 7, 2018 06:40
html5 fullscreen
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>