Skip to content

Instantly share code, notes, and snippets.

@mossieur
mossieur / kpop.m3u
Last active May 16, 2023 09:13
k-pop 24/7
View kpop.m3u
#EXTM3U
#EXTINF:-1 tvg-id="TheKPop.kr" tvg-logo="https://i.imgur.com/zsEahcW.png" group-title="kpop",THE K-POP
http://51.91.57.106:3000/channel/UCoRXPcv8XK5fAplLbk9PTww.m3u8
#EXTINF:-1 tvg-id="AlltheKPop.kr" tvg-logo="https://i.imgur.com/IFLXi6n.png" group-title="kpop",ALL THE K-POP
http://51.91.57.106:3000/channel/UCPde4guD9yFBRzkxk2PatoA.m3u8
@nekomimi-daimao
nekomimi-daimao / ShellExecutor.cs
Last active May 16, 2023 09:10
Execute shell from UnityEditor
View ShellExecutor.cs
#if UNITY_EDITOR
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
// ReSharper disable MergeIntoNegatedPattern
@superseb
superseb / README.md
Last active May 16, 2023 09:08
Retrieve kubeconfig from RKE or Rancher 2 custom cluster controlplane node for RKE v0.2.x+ and Rancher v2.2.x+
View README.md

Retrieve kubeconfig from RKE v0.2.x or Rancher v2.2.x custom cluster controlplane node

For RKE v0.1.x and Rancher v2.0.x/v2.1.x, see https://gist.github.com/superseb/3d8de6092ebc4b1581185197583f472a

This needs to be run on a node with the controlplane role, as it rewrites the server endpoint to https://127.0.0.1:6443, you can of course manually change this if necessary.

Applicable for:

  • RKE v0.2.x
  • Rancher v2.2.x
@rafaelldi
rafaelldi / Monitoring TCP & UDP connections.md
Last active May 16, 2023 09:07
Monitoring TCP & UDP connections
View Monitoring TCP & UDP connections.md

Checking Windows network configuration

Command Alternative Description
Get-NetIPConfiguration ipconfig -all displays the IP network configuration
Get-NetAdapter shows various network adapter properties
Get-NetRoute netstat -r prints the IP routing table
Get-NetTCPSetting gets system TCP settings
Get-NetUDPSetting gets system UDP settings
Get-NetFirewallRule lists firewall rulles
@mattia-beta
mattia-beta / ddos.conf
Last active May 16, 2023 09:06
IPtables DDoS Protection for VPS
View ddos.conf
### 1: Drop invalid packets ###
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
### 2: Drop TCP packets that are new and are not SYN ###
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
### 3: Drop SYN packets with suspicious MSS value ###
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
### 4: Block packets with bogus TCP flags ###
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
View gist:710671
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@rain-1
rain-1 / llama-home.md
Last active May 16, 2023 09:05
How to run Llama 13B with a 6GB graphics card
View llama-home.md

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@hyperupcall
hyperupcall / settings.jsonc
Last active May 16, 2023 09:04
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
View settings.jsonc
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@gdavis
gdavis / swiftui-state.markdown
Last active May 16, 2023 09:04
Swift UI State Management
View swiftui-state.markdown

Swift UI State Management

Storing state for Child View Models

SwiftUI is all about state, and maintaining that state can be rather difficult when you have more than a few properties stored as @State for your view. It is common practice to use a view model to store the state outside of the view, since our views are constantly recreated as our state changes. Keeping what state you want in memory can provide a challenge, much more so than it may seem at first glance.

With SwiftUI 2, using @StateObject will keep a view model from being recreated with each rendering of a view's body. If the parent view is creating the view model, and then passing that down to the child view, that view model will also be recreated with each rendering of that parent view body.

struct ParentView: View {
  var body: some View {
@AntonLydike
AntonLydike / risc-v.tex
Last active May 16, 2023 09:02
RISC-V Assembler lstlisting syntax and style
View risc-v.tex
% RISC-V Assembler syntax and style for latex lstlisting package
%
% These are risc-v commands as per our university (University Augsburg, Germany) guidelines.
%
% Author: Anton Lydike
%
% This code is in the public domain and free of licensing
% language definition
\lstdefinelanguage[RISC-V]{Assembler}