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.
/*
* 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.
*/
function createOption($listItem, $input)
{
$listItem.on('click tap', function(evt)
{
var checked = $input.prop('checked');
$input.toggleProp('checked', !checked);
$listItem.toggleClass('selected', checked);
});
}
# goes in folder that holds symlinks to project files (/home/jim/sites/dev)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.]+)\.local.dev
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/
RewriteRule ^(.*)$ /%1/$1 [L]
RewriteCond %{HTTP_HOST} ^([^.]+)\.dev\.local
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/
RewriteRule ^(.*)$ /%1/$1 [L]