Skip to content

Instantly share code, notes, and snippets.

@Om4ar
Om4ar / dump.txt
Last active June 14, 2021 09:21 — forked from basiszwo/google-cloud-memorystore-dump.md
Dump Redis rdb file from Google Cloud MemoryStore
First, create a dump on server A.
A$ redis-cli
127.0.0.1:6379> CONFIG GET dir
1) "dir"
2) "/var/lib/redis/"
127.0.0.1:6379> SAVE
OK
This ensures dump.rdb is completely up-to-date, and shows us where it is stored (/var/lib/redis/dump.rdb in this case). dump.rdb is also periodically written to disk automatically.
@Om4ar
Om4ar / launch.json
Created January 14, 2021 19:27 — forked from TsuyoshiUshio/launch.json
Acceptance Testing Settings
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Acceptance test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/azuredevops/resource_project_test.go",
"args": [
@Om4ar
Om4ar / download.sh
Created October 28, 2020 18:48 — forked from jmurphyau/download.sh
Download HLS Stream with FFmpeg
#this
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy project5.mp4
# or this
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy -bsf:a aac_adtstoasc project3.mp4
@Om4ar
Om4ar / cheat_sheet.md
Created October 17, 2020 16:12 — forked from nhudinhtuan/cheat_sheet.md
15 days cheat sheet for interviews
@Om4ar
Om4ar / README.md
Created October 3, 2020 14:47 — forked from roachhd/README.md
Teach Kids Programming

Teach kids programming 🆒

2 min read

![][4]

A collection of resources

I've been gathering the best resources to teach children & teens programming — books, environments, apps, courseware and games.

@Om4ar
Om4ar / dockergrep.sh
Created July 28, 2020 15:51 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@Om4ar
Om4ar / git-submodules.md
Created April 28, 2020 11:52 — forked from u840903/git-submodules.md
Github Submodule Cheat Sheet

Add a submodule

git submodule add https://github.com/janjarfalk/canvasrunner.git components/canvasrunner/

Update all submodules

git submodule foreach git pull origin master
cd ..
git commit . -m "Updated submodules"
@Om4ar
Om4ar / gist:4f0aa9207779839f0a8dda899ee97081
Last active April 25, 2020 03:26 — forked from kfei/gist:5dbb32f118f373fc1a47
Convert GIF using ffmpeg and ImageMagick
# Use ffmpeg to decode input video (GIF in this case)
ffmpeg -i input.gif decode/%d.png
# Use ImageMagick to crop, format: (W)x(H)+(W_SFHIT)+(H_SHIFT)
# Note the {from..to..skip} usage of Bash
convert decoded/{1..759..5}.png -crop 315x172+20+40 resized/%d.png
# An resize option
# convert decoded/{1..759..5}.png -crop 315x172+20+40 -resize 30% resized/%d.png
@Om4ar
Om4ar / kafka-cheat-sheet.md
Last active September 13, 2020 18:12 — forked from ursuad/kafka-cheat-sheet.md
Quick command reference for Apache Kafka

Kafka Topics

Describe a topic

kafka-topics --zookeeper localhost:2181 --describe --topic TOPIC_NAME

list topic offsets

sudo docker run --net=host --rm confluentinc/cp-kafka:4.1.2-2 kafka-consumer-groups --bootstrap-server localhost:9092 --describe --group GROUP_NAME

Get Members