Skip to content

Instantly share code, notes, and snippets.

@dhilgarth
dhilgarth / debugging swarm network.md
Last active July 15, 2025 10:20
Troubleshoot Docker Swarm Network issues

See moby/moby#47728 for context.

Issue 1: Packets sent to wrong node

I've just had the case that the networkDB looked correct, but the packages were still being routed to the wrong node.

Details: Node S, running the source container, has IP 172.17.2.2 Node T, running the target container, has IP 172.16.3.2

@michaeltreat
michaeltreat / mongodb_shell_commands.md
Last active April 28, 2026 00:49
Quick Cheat Sheet for Mongo DB Shell commands.

MongoDB Shell Commands Cheat Sheet.

This is a Cheat Sheet for interacting with the Mongo Shell ( mongo on your command line). This is for MongoDB Community Edition.

Preface:

Mongo Manual can help you with getting started using the Shell.

FAQ for MongoDB Fundamentals and other FAQs can be found in the side-bar after visiting that link.

@soulmachine
soulmachine / jwt-expiration.md
Last active May 3, 2026 13:29
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@indigo423
indigo423 / gist:4a7f81dd39aa3269e462b2e4129fba6c
Last active March 13, 2025 06:17
SNOM VoIP sample output
1.3.6.1.2.1.7526.2.1.1 = INTEGER: 68308908 Rx Bytes Integer The total number of bytes received
1.3.6.1.2.1.7526.2.1.2 = INTEGER: 391350 Rx Packets Integer The total number of packets received
1.3.6.1.2.1.7526.2.2.1 = INTEGER: 80599243 Tx Bytes Integer The total number of bytes sent
1.3.6.1.2.1.7526.2.2.2 = INTEGER: 348929 Tx Packets Integer The total number of bytes sent
1.3.6.1.2.1.7526.2.3.1 = INTEGER: 1 Registration Integer Registration status of registration x (1..12) (works with v6.5 or newer)
1.3.6.1.2.1.7526.2.4 = STRING: "snomD375-SIP 8.9.3.60 2010.12-00003-g3143800" Firmware & U-Boot Version String The currently used firmware & uboot version (for exampl
@allebb
allebb / mssqlbackup
Last active May 31, 2024 07:57
Shell script to backup Microsoft SQL Server vNEXT databases on Linux.
#!/usr/bin/env bash
#
# Shell script to automate the backup of Microsoft SQL Server vNEXT backups on Linux.
# Written by Bobby Allen <ballen@bobbyallen.me>, 26/04/2017
#
# Download this script and put into your servers' /usr/bin directory (or symlink) then make it executable (chmod +x)
#
# Usage example (backup databases into /var/backups, keep backups for 5 days, connect to server "localhost" with the account "sa" and a password of "P455w0RD"):
# mssqlbackup "/var/dbbackups" 5 "localhost" "sa" "P455w0rD"
@pstuashiqcse
pstuashiqcse / android_layout_ripple
Created January 23, 2017 14:53
Circular ripple and click ripple effect to android xml layout
android:background="?attr/selectableItemBackgroundBorderless"
android:background="?attr/selectableItemBackground"
@AlexKorsakov
AlexKorsakov / Form2.cs
Created December 18, 2016 20:49
Second C# Wake On Lan Program
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
namespace WakeOnLan2
{
public class WakeOnLan
{
public static void Send(string TargetMac, string SourceIp)
{
@AlexKorsakov
AlexKorsakov / Form1.cs
Created December 18, 2016 20:48
C# Wake On Lan Program
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@maciekish
maciekish / resetXcode.sh
Created August 10, 2016 10:13
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app