Skip to content

Instantly share code, notes, and snippets.

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 28, 2024 17:02
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@Zwyx
Zwyx / encrypt.sh
Last active April 28, 2024 17:01
Display detailed information about a password store and reencrypt it
#!/bin/bash
# Created by github.com/Zwyx
# MIT Licence
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
echo "Usage: ./encrypt.sh [subfolder-name]..."
exit
fi
@sara-hines
sara-hines / regex-html-tag-match.md
Last active April 28, 2024 17:01
Learning Regex Basics: Tutorial for Matching an HTML Tag

Learning Regex: Tutorial for Matching an HTML Tag

Regular Expressions, abbreviated as regex, are a beneficial tool add to one's skill set as a developer. Regex are patterns which match character combinations in strings and which can capture sections of strings for later use. This makes regex valuable for find-and-replace operations, form validation, cleaning input, and reformatting input. Using regex with string methods such as test(), exec(), match(), and replace() can open up new capabilities for working with strings, especially for newer developers. Regular expressions can be created using a regular expression literal, which uses a pattern wrapped in a forward slash (/) before and after the pattern, or by using the Regular Expression constructor function. This article will use a regular expression literal to walk through some of the most fundamental components of regex.

Summary

The following regex pattern matches HTML elements and their tags, whether the element incl

@slingamn
slingamn / against_scram.md
Created August 13, 2021 01:15
Against SCRAM

Against SCRAM

I added support for the SCRAM-SHA-256 authentication mechanism to the Ergo IRC server, in response to demand for a reference implementation that clients could test against. Conversely, if you're implementing a server, I added an irctest server test covering it.

Nonetheless, this decision should not be taken as an endorsement of SCRAM. I recommend against implementing SCRAM-SHA-256 or any other SCRAM variant. Here's why.

The baseline: SASL PLAIN over TLS

@badrelmers
badrelmers / Portable_Virtualbox.md
Last active April 28, 2024 17:01
portable virtualbox using the latest virtualbox installers

This makes virtualbox works in a portable mode:

  • if you have any installed virtualbox then uninstall it first
  • download https://download.virtualbox.org/virtualbox/7.0.8/VirtualBox-7.0.8-156879-Win.exe or any newer or older version
  • click on Download ZIP above to download the scripts needed
  • create a folder inside your USB/external drive or whatever, name it myVMBOX (ex. F:\myVMBOX if your USB is in F:\).
  • inside F:\myVMBOX put the virtualbox exe we just downloaded (VirtualBox-7.0.8-156879-Win.exe) and rename it to VirtualBox.exe.
  • inside F:\myVMBOX put the following files start_virtualbox.bat and uninstall_virtualbox.bat, you will find them inside the zip you just downloaded.
  • now everytime you want to start virtualbox use start_virtualbox.bat.
// Define a class for a character
class Character {
constructor(name, strength, agility, criticalStrikeChance, criticalStrikeBonus, dodge) {
this.name = name;
this.strength = strength;
this.agility = agility;
this.criticalStrikeChance = criticalStrikeChance;
this.criticalStrikeBonus = criticalStrikeBonus;
this.dodge = dodge;
this.health = 100; // Starting health
@ricardojba
ricardojba / windows_hardening.cmd
Last active April 28, 2024 16:59
A Windows hardening script
::##########################################################################################################################
::
:: This script can ruin your day, if you run it without fully understanding what it does, you don't know what you are doing,
::
:: OR BOTH!!!
::
:: YOU HAVE BEEN WARNED!!!!!!!!!!
::
:: This script is provided "AS IS" with no warranties, and confers no rights.
:: Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section,
@jaredhaight
jaredhaight / windows_hardening.cmd
Last active April 28, 2024 16:59 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS.
::
::#######################################################################
::
:: Change file associations to protect against common ransomware attacks
:: Note that if you legitimately use these extensions, like .bat, you will now need to execute them manually from cmd or powershell
:: Alternatively, you can right-click on them and hit 'Run as Administrator' but ensure it's a script you want to run :)
:: ---------------------
ftype htafile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
ftype WSHFile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
ftype batfile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RPG Game</title>
<style>
body {
margin: 0;
padding: 0;
@xitarps
xitarps / gist:40e4153cb50df4a51da5400508488d5b
Last active April 28, 2024 16:59
vscode settings.json
{
"json.schemas": [
],
"emmet.includeLanguages": {"erb": "html"},
"editor.rulers": [
80,
120
],
"launch": {
"configurations": [],