Skip to content

Instantly share code, notes, and snippets.

View rcdevgames's full-sized avatar
🏠
Working from home

Rizky Andhika rcdevgames

🏠
Working from home
View GitHub Profile
@rcdevgames
rcdevgames / 1-init.cmd
Created January 21, 2024 06:18 — forked from RobbiNespu/1-init.cmd
Portable postgre SQL on windows
@ECHO ON
:: Save the directory where we are
pushd %CD%
echo %CD%
:: Shift directories to the correct path
%~d0
cd %~dp0
@rcdevgames
rcdevgames / docker_clean.sh
Created October 6, 2023 09:01 — forked from dantheman213/docker_clean.sh
Reset Docker to a clean vanilla state
#!/usr/bin/env bash
# Reset Docker to a clean vanilla state. Will destroy all containers, images, networks, volumes, and cache.
[ $(docker ps | wc -l) -ne 1 ] && echo "Stopping all containers..." && docker stop $(docker ps | sed -n '1d;p' | awk -F" " '{print $1}')
[ $(docker ps -a | wc -l) -ne 1 ] && echo "Deleting all containers..." && docker rm $(docker ps -a | sed -n '1d;p' | awk -F" " '{print $1}')
[ $(docker images | wc -l) -ne 1 ] && echo "Deleting all images..." && docker image rm $(docker images | sed -n '1d;p' | awk -F" " '{print $3}')
echo "Pruning networks, volumes, and cache..." && docker system prune -a -f --volumes
echo "Docker is back to Vanilla... COMPLETE!"
@rcdevgames
rcdevgames / minio-docker-steps.md
Created September 25, 2023 03:04 — forked from nitisht/minio-docker-steps.md
minio-docker-swarm
  • Pre-Conditions: https://docs.docker.com/engine/swarm/swarm-tutorial/#/three-networked-host-machines For distributed Minio to run, you need 4 networked host machines.

  • Create a new swarm and set the manager. SSH to one of the host machine, which you want to set as manager and run: docker swarm init --advertise-addr <MANAGER-IP>

  • Current node should become the manager. Check using: docker node ls

  • Open a terminal and ssh into the machine where you want to run a worker node.

  • Run the command as output by the step where master is created. It will add the current machine (as a worker) to the swarm. Add all the workers similarly.

  • Check if all the machines are added as workers, SSH to the master and run: docker node ls

Create an overlay network:

#!/usr/bin/env bash
# Installs/Configures:
# - Docker
# - Docker Registy Container with self-signed cert
#
# Tested on Ubuntu 14.04.1
# Must be executed with elevated privilages
if [ "$(id -u)" != "0" ]; then
@rcdevgames
rcdevgames / ssh-banner.md
Created October 6, 2022 09:04 — forked from holmberd/ssh-banner.md
SSH welcome banner with FIGlet

SSH Welcome banner with FIGlet

  • sudo apt-get install figlet
  • sudo touch /etc/update-motd.d/10-my-banner
  • sudo chmod +x /etc/update-motd.d/10-my-banner

10-my-banner.sh:

#!/bin/sh
if ("undefined" == typeof ZotataPlayUserID) var ZotataPlayUserID = "";
if ("undefined" == typeof ZotataPlayAuthKey) var ZotataPlayAuthKey = "";
if ("undefined" == typeof debug) var debug = -1 != location.hostname.indexOf("t.dragonbound.net");
var VERSION = 101,
SERVER_ADDRESS = -1 != location.hostname.indexOf("t.dragonbound.net") ? "http://t.dragonbound.net:9000" : "http://game.dragonbound.net:80",
LOCATION_TYPE_UNKNOWN = "unknown",
LOCATION_TYPE_CHANNEL = "channel",
LOCATION_TYPE_ROOM = "room",
ROOM_STATUS_WAITING = "W",
ROOM_STATUS_FULL = "F",
@rcdevgames
rcdevgames / index.html
Created June 7, 2022 01:41
PyScript Sample
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PyScript Test</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>
</head>
@rcdevgames
rcdevgames / python.json
Created June 6, 2022 14:39 — forked from kpalin/python.json
vs code snippet pyscript for python boilerplate
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",

Download CMake from: https://cmake.org/download/

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Compile from source and install

tar zxvf cmake-3.*
@rcdevgames
rcdevgames / tinder-api-documentation.md
Created January 6, 2022 02:48 — forked from rtt/tinder-api-documentation.md
Tinder API Documentation

Tinder API documentation

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

Note: this was written in April/May 2014 and the API may have changed since. I have nothing to do with Tinder, nor their API, and I do not offer any support for anything you may build on top of this

API Details