Skip to content

Instantly share code, notes, and snippets.

View Exagone313's full-sized avatar
🌠
Working from the stars

Elouan Martinet Exagone313

🌠
Working from the stars
View GitHub Profile

Bcrypt hash Compare issues

Bcrypt hashes generated by golang will not validate in node.js and vice versa

Golang

Get one external dependency:

go get golang.org/x/crypto/bcrypt

Then run:

@hemebond
hemebond / 0_article.md
Last active March 13, 2022 11:51
A SaltStack AWS Auto Scaling Solution

A SaltStack AWS Auto Scaling Solution

Overview

The AWS Auto Scaling Goup, configured with a customised Cloud-Init file, sends a notification to an SNS Topic, which in turn passes it onto an SQS queue that the Salt Master is subscribed to. A Reactor watches for the auto scaling events and pre-approves the new minion based on its Auto Scaling group name and instance ID.

Salt Master Configuration

@nikoskip
nikoskip / gfonts.php
Last active September 20, 2022 21:34
Demo: http://nikoskip.me/gfonts.php | You only have to use the CSS import URL that Google gives you, for instance: http://fonts.googleapis.com/css?family=Cabin:500,700,500italic,700italic
<?php
$fontTypes = array('woff2', 'woff', 'ttf', 'svg', 'eot');
$gFontURL = 'http://fonts.googleapis.com/css?family=';
$uaFonts = array(
'woff2' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36',
'woff' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)',
'ttf' => 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
'svg' => 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10',
@mikdusan
mikdusan / foo.zig
Last active December 19, 2022 17:42
pub fn main() void {
const user_config_dir = "/tmp/foo";
// 1. swap out the `*c` notation: `[*c]u8` -> `[*:0]u8`
// 2. add const to indicate these aren't mutable: `[*:0]u8` -> `[*:0]const u8`
// 3. add `?` to indicate the item (null-term string) is optional: `[*:0]const u8` → `?[*:0]const u8`
var search0: [2]?[*:0]const u8 = [2]?[*:0]const u8{
user_config_dir,
null,
};
@AndrewLipscomb
AndrewLipscomb / README.md
Created March 24, 2020 11:06
How to set up static nspawn IP address networking without a bridge

How to set up static nspawn IP address networking without a bridge

Note - this article assumes you have reasonable familiarity with systemd, networkd and nspawn/machinectl

What is this guide for

There seem to be a lot of references on the internet for nspawn networking with a bridge - but not on simply using the stock veth networking with static addresses. The default behaviour of nspawn (as of 24/03/20 and systemd:245 on Arch) is to:

  • Make a virtual ethernet port on the host (defined by /lib/systemd/network/80-container-ve.network)
  • Make a virtual ethernet port in the container (defined by /lib/systemd/network/80-container-host0.network)
  • Based on those configurations, serve the host port a random IP from the local network ranges with a 28 bit subnet, and a DHCP server for the host port serves a random IP in the subnet to the container
@p1nox
p1nox / postgresql_configuration_on_ubuntu_for_rails.md
Last active November 29, 2023 04:38
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@paulshen
paulshen / natto-eval.js
Created April 13, 2021 16:11
natto.dev eval pseudocode
const f = useMemo(() => {
try {
return new Function('inputs', `return ${expression}`);
} catch (e) {
return [e];
}
}, [expresssion]);
// input atoms
@robertkirkman
robertkirkman / README.md
Last active March 25, 2024 01:06
How to record or stream SteamOS 3.X Gaming Mode

How to record or stream SteamOS 3.X in gamescope (Gaming Mode)

Here is another method that uses Flatpak and obs-vkcapture, which don't meet my personal needs but are very likely to be useful for you. In the comments there there is also an obs-gstreamer method.

Here is another method for recording that has its own GUI for Gaming Mode built with Decky Loader.

Force SteamOS to behave very much like Arch Linux

Key phrase: very much like, not identical. Always treat this as more unstable than Manjaro and only expect support with it in my comments section here.

  1. Set a password (if you haven't already) and disable read-only rootfs (yes this means after updating SteamOS [not Steam Client] this will all be deleted and you will have to do all this again if you want
@subfuzion
subfuzion / global-gitignore.md
Last active April 23, 2024 22:47
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.