Skip to content

Instantly share code, notes, and snippets.

@alanwei43
alanwei43 / windows-port-proxy.md
Last active April 18, 2024 11:19
windows powershell port forward
netsh interface portproxy add v4tov4 protocol=tcp connectaddress=192.168.67.128 connectport=9091 listenport=9091
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active April 18, 2024 11:18
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@Jaykul
Jaykul / Agent Passthru.md
Last active April 18, 2024 11:18
SSH Agent passthru to WSL 2 (working, in Windows 11, in May 2023)

For awhile now, each time I got a new Windows laptop I would dig up strasis gist on how to set up agent forwarding for SSH in WSL2 -- but recently I tried to point someone else at it and they were very confused by it, so this is my attempt at simpler instructions.

Installation

With Chocolatey, you must use an elevated PowerShell session. If there's no choco command found, it will fall back to winget for the npiperelay install. To force using Winget even if you have choco installed, you need to download it, so you can pass parameters to it.

Easy mode: just run this in PowerShell:

@m5lil
m5lil / reset.sh
Last active April 18, 2024 11:16
[reset jetbrains application trial] reset jetbrains ide evals v1.0.4 #others
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
@trandaison
trandaison / starUML.md
Last active April 18, 2024 11:16
Get full version of StarUML
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 18, 2024 11:15
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@Akhil-Suresh
Akhil-Suresh / postman_installation.md
Last active April 18, 2024 11:15
Installing Postman on Ubuntu/Debian

Installing Postman

Step 1

If any version of postman is installed we need to remove it

sudo rm -rf /opt/Postman

Step 2

@davidbau
davidbau / runningstats.py
Last active April 18, 2024 11:15
Running stats objects for pytorch: mean, variance, covariance, second-moment, quantiles, topk, and combinations.
'''
To use a runningstats object,
1. Create the the desired stat object, e.g., `m = Mean()`
2. Feed it batches via the add method, e.g., `m.add(batch)`
3. Repeat step 2 any number of times.
4. Read out the statistic of interest, e.g., `m.mean()`
Built-in runningstats objects include:
@MelissaBruno
MelissaBruno / Blackjack.java
Created March 16, 2016 23:49
A game of blackjack in Java
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Scanner;
public class Blackjack {