Skip to content

Instantly share code, notes, and snippets.

View vladfrangu's full-sized avatar
🛠️
Writing & Breaking Code

Vlad Frangu vladfrangu

🛠️
Writing & Breaking Code
View GitHub Profile
@ishad0w
ishad0w / oci_ubuntu_to_debian.multiarch.sh
Last active April 15, 2024 21:07
Debian 12 on Oracle Cloud (Free Tier) - (AMD64/ARM64)
#!/bin/bash
echo -e "\nHost:"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -p 22 ubuntu@$1 \
'uname -a && arch && uptime && sudo touch /home/ubuntu/.hushlogin /root/.hushlogin'
echo -e "\nAdding temporary SSH-key for Ubuntu root user..."
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -p 22 ubuntu@$1 \
'sudo cat /home/ubuntu/.ssh/authorized_keys | sudo tee /root/.ssh/authorized_keys'
echo -e "\nSystem trimming..."
@slykar
slykar / docker-compose-hackintosh.md
Last active May 7, 2024 13:53
Docker and Docker Compose on AMD OSX Hackintosh via Docker Machine

Introduction

Docker.app will complain about incompatible processor, so we will use Docker Machine.

Instalation

Download Docker for Mac (Docker.app). It contains some binaries that are necessary.

brew install virtualbox docker-machine
@Bradshaw
Bradshaw / better_sin.js
Created June 28, 2017 08:47
Better version of Math.sin for javascript
var old_sin = Math.sin;
Math.sin = function(x) {
if (typeof x == "number" && isFinite(x)){
return old_sin(x);
}
var str = "" + x;
if (str.length>0){
str = str.repeat(Math.ceil(Math.max(1,18/str.length)));
}
var sinstr = "|\n";
@yoavniran
yoavniran / simple-nodejs-iv-encrypt-decrypt.js
Last active January 20, 2022 08:16
nodejs crypto - simple encrypt & decrypt using IV (Initialization Vector)
"use strict";
var crypto = require("crypto");
var EncryptionHelper = (function () {
function getKeyAndIV(key, callback) {
crypto.pseudoRandomBytes(16, function (err, ivBuffer) {
var keyBuffer = (key instanceof Buffer) ? key : new Buffer(key) ;
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE