Skip to content

Instantly share code, notes, and snippets.

@yokawasa
yokawasa / aks-cheat-sheet.md
Last active April 29, 2024 09:18
Azure Kubernetes Services Cheat Sheet
@eduardo-matos
eduardo-matos / rabbit-graceful-shutdown.js
Last active April 29, 2024 09:13
RabbitMQ graceful shutdown in NodeJS
const amqp = require('amqplib');
const uuid = require('uuid')
const CONSUMER_TAG = uuid.v4();
const QUEUE_NAME = 'my_queue'
async function main() {
const conn = await amqp.connect('amqp://guest:guest@localhost:5672/%2F');
const channel = await conn.createChannel();
await channel.assertQueue(QUEUE_NAME);
@mberman84
mberman84 / main.py
Created November 10, 2023 16:17
OpenChat Code
import requests
import json
import gradio as gr
url = "http://localhost:11434/api/generate"
headers = {
'Content-Type': 'application/json',
}
@rlouf
rlouf / gmail.py
Created January 6, 2018 13:57 — forked from jasonrdsouza/gmail.py
Python script to access a gmail account and download particular emails
import email, getpass, imaplib, os
detach_dir = '.' # directory where to save attachments (default: current)
user = raw_input("Enter your GMail username:")
pwd = getpass.getpass("Enter your password: ")
# connecting to the gmail imap server
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login(user,pwd)
m.select("cs2043") # here you a can choose a mail box like INBOX instead
@sataniceypz
sataniceypz / alive.js
Last active April 29, 2024 09:12 — forked from Kingbadan321/alive.js
Custom Alive For Izumi-xd
const { command, isPrivate, getBuffer } = require("../lib/");
const config = require("../config");
// Edit here ๐Ÿ‘‡๐Ÿฟ๐ŸŒธ
let title = "๐—œ๐—ญ๐—จ๐— ๐—œ-๐—ซ๐——"
let body = "๐—›๐—ฒ๐˜† ๐—œ๐˜‡๐˜‚๐—บ๐—ถ ๐—ถ๐˜€ ๐—”๐—น๐—ถ๐˜ƒ๐—ฒ๐Ÿงšโ€โ™‚๏ธ"
let sourceUrl = "github.com/sataniceypz/Izumi-v2"
let mediaUrl = "github.com/sataniceypz/Izumi-v2"
let mediaType = 1
@tuxity
tuxity / navicat_premium_reset_trial.sh
Last active April 29, 2024 09:06
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@wych42
wych42 / linux-system-monitor-metrics-checklist.md
Created June 29, 2016 04:03
linux ็ณป็ปŸ็›‘ๆŽงๆŒ‡ๆ ‡
@yokawasa
yokawasa / ghcr.md
Last active April 29, 2024 08:56
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@berndbausch
berndbausch / LXD-cheat-sheet.md
Last active April 29, 2024 08:56
LXD cheat sheet

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names
@1nikolas
1nikolas / genymotion-4.x.md
Last active April 29, 2024 08:52
Install Android 4.1, 4.2, 4.3 on Genymotion

Install Android 4.1, 4.2, 4.3 on Genymotion

I found a way to install older Android versions (4.x) on latest version of Genymotion. I only tested it on Windows but it should work on Mac and Linux too. So here is what you need to do:

Step 1

Download the required Android image. I've reuploaded the files to Mega and saved them on the WayBack Machine.