Skip to content

Instantly share code, notes, and snippets.

View jimmysawczuk's full-sized avatar

Jimmy Sawczuk jimmysawczuk

View GitHub Profile
@jimmysawczuk
jimmysawczuk / set-chroot.sh
Created July 5, 2021 23:50 — forked from Tamal/set-chroot.sh
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ mount /dev/mapper/fedora_localhost--live-root /mnt # mount root partition
$ cat /mnt/etc/fedora-release
Fedora release 31 (Thirty One)
$ mount /dev/nvme0n1p2 /mnt/boot # mount boot partition
$ mount /dev/nvme0n1p1 /mnt/boot/efi # mount EFI partition
# Note: If you are not able to mount EFI partition ('Input/Output error'),
# You may have to repair ESP file system or format ESP.

Keybase proof

I hereby claim:

  • I am jimmysawczuk on github.
  • I am jimmysawczuk (https://keybase.io/jimmysawczuk) on keybase.
  • I have a public key whose fingerprint is 5C2E C85E 5E65 C3BF A08D C84D FE3B 2963 237E 1C3B

To claim this, I am signing this object:

/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/
@jimmysawczuk
jimmysawczuk / unflatten.go
Last active November 4, 2017 03:45
unflattens a JSON object and makes it whole again
package main
import (
"encoding/json"
"fmt"
"strconv"
"strings"
)
func main() {
@jimmysawczuk
jimmysawczuk / 00-README.md
Created September 15, 2017 15:32
Close all daily boards

Copy these files into a new directory, then run composer install, then get your API key and token, then run.

!function(win, doc, element, url, queue, new_script, invoking_script)
{
// this function is going to attempt to define a queue function we can use to track events. if
// we've defined it once, we're done.
if (win.fbq) return;
// callMethod is defined once we load the Facebook library, but if we get an fbq call before then we'll
// all the arguments onto a queue to be dealt with later.
queue = win.fbq = function()
{
<?php
function array_add(&$arr, array $parts, $val = 1)
{
if (count($parts) > 1)
{
if (!isset($arr[$parts[0]]))
{
$arr[$parts[0]] = [];
}
@jimmysawczuk
jimmysawczuk / Makefile
Created April 10, 2015 15:52
Makefile variable debug snippet
print-%: ; @echo $*=$($*)
# from http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html
function createOption($listItem, $input)
{
$listItem.on('click tap', function(evt)
{
var checked = $input.prop('checked');
$input.toggleProp('checked', !checked);
$listItem.toggleClass('selected', checked);
});
}
@jimmysawczuk
jimmysawczuk / Screensaver.applescript
Last active August 29, 2015 14:05
Screensaver.applescript
set volume with output muted
tell application "iTunes"
if it is running then
pause
end if
end tell
tell application "ScreenSaverEngine" to activate