Skip to content

Instantly share code, notes, and snippets.

@rkochar
rkochar / fix-grub.md
Last active February 29, 2024 18:18
Windows deleted grub (Manjaro)
  • Boot into Manjaro on usb stick
  • ctrl+alt+t
  • sudo manjaro-chroot -a
  • grub-install <partition> (eg: /dev/nvme0n1p6 or /dev/sda)
  • grub-install --recheck <partition>
  • update-grub
  • exit
  • reboot (remove usb stick, grub should re-appear with Manjaro as a boot option)

Grub may not add Windows (or another boot option) to the menu. Boot into Manjaro.

@tonytonyjan
tonytonyjan / copyExif.js
Last active December 16, 2023 11:43
copy EXIF from one JPEG blob to another and return a new JPEG blob.
// Copyright (c) 2019 Weihang Jian <tonytonyjan@gmail.com>
export default async (src, dest) => {
const exif = await retrieveExif(src);
return new Blob([dest.slice(0, 2), exif, dest.slice(2)], {
type: "image/jpeg"
});
};
export const SOS = 0xffda,
@DenisFrezzato
DenisFrezzato / vm-vb-mac.sh
Last active March 9, 2024 22:25
Configuration script for a Mac OS X VirtualBox virtual machine.
# The first parameter is the name of the virtual machine.
# @see https://medium.com/@twister.mr/installing-macos-to-virtualbox-1fcc5cf22801
# @see https://techsviewer.com/how-to-install-mac-os-x-el-capitan-on-pc-on-virtualbox/
VBoxManage modifyvm "$1" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "$1" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "$1" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "$1" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "$1" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "$1" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
@krishamoud
krishamoud / app.config
Last active June 3, 2019 11:18
Deploy Meteor onto Elastic Beanstalk
option_settings:
- option_name: AWS_SECRET_KEY
value: -------------------------------------------
- option_name: AWS_ACCESS_KEY_ID
value: ------------------------------
- option_name: PORT
value: 8081
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@pguillory
pguillory / gist:729616
Created December 5, 2010 23:51
Hooking into Node.js stdout
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}