Skip to content

Instantly share code, notes, and snippets.

@pm-hwks
pm-hwks / netcat.sh
Created August 21, 2019 07:03
[Netcat network test] Netcat commands to test bandwidth between 2 linux servers #netcat #perf-test #linux #network
## Netcat server command
nc -l <unused port # > /dev/null
eg:
nc -l 1122 > /dev/null
## Netcat Client command
dd if=/dev/zero bs=9100004096 count=1 | nc <netcat server> <netcat port>
eg:
dd if=/dev/zero bs=9100004096 count=1 | nc 10.0.1.251 1122
@StefanScherer
StefanScherer / Vagrantfile
Created June 25, 2018 05:32
Turn on auto logon in a sysprepped Vagrant box
Vagrant.configure("2") do |config|
config.vm.define "tst" do |cfg|
cfg.vm.box = "StefanScherer/windows_2016"
cfg.vm.hostname = "tst"
cfg.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "2048"
vb.linked_clone = true
end
@nadavrot
nadavrot / Matrix.md
Last active August 16, 2024 08:59
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@gregdel
gregdel / gogs-migrate.sh
Last active April 26, 2022 01:01
Gitlab to gogs migration
#!/bin/sh
set -e
_usage() {
echo "Usage: $0 [--user|org] USER_OR_ORG_NAME GOGS_REPO_NAME GITLAB_HTTPS_URL"
exit 0
}
MODE=$1
awk -v pat='zonename|create_timestamp|billing_id|owner_uuid|mac|uuid|zone_state|zonepath|zoneid|last_modified|server_uuid|datacenter_name|state|boot_timestamp|pid|zfs_root_recsize|zfs_filesystem|zpool|zfs_data_recsize' '$0~pat {n=2}; n {n--; next}; 1' x.json
@pavel-perina
pavel-perina / fixed_aspect_ratio_qlayout.h
Last active June 15, 2023 12:33
QLayout that keeps fixed aspect ratio of it's only widget.
/*
Copyright (c) 2017 Pavel Perina
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Name Ownership Copyable Movable Sharing Lifetime Semantics
unique_ptr Unique Lexical Reference
shared_ptr Shared Reference Reference-counted Reference
weak_ptr Non-extending Optional-reference
value_ptr Unique Value Lexical Value
@culots
culots / gpt_parser.py
Created September 2, 2016 07:19
Feed this your GPT.bin, and out it shoots a partition.xml
#!/usr/bin/python
# Author : n0fate
# E-Mail rapfer@gmail.com, n0fate@live.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.

Creating a redis Module in 15 lines of code!

A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.

Step 1: open your favorite editor and write/paste the following code in a file called module.c

#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
@alirobe
alirobe / reclaimWindows10.ps1
Last active August 31, 2024 20:27
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###