Create ~/.ssh/github folder
ssh-keygen -t rsa -b 4096 -C '[email protected]' -f ~/.ssh/github/personal -q -N ''
# from pynput.keyboard import Key, Controller | |
import time | |
import random | |
import sys | |
import pyautogui | |
from datetime import datetime | |
# keyboard = Controller() | |
start = 20 | |
end = 59 |
export const getDeletedItems = ( | |
primarykey: string, | |
oldValues: Array<any>, | |
newValues: Array<any> | |
): Array<any> => { | |
return oldValues.filter((old) => { | |
return !newValues.some((newValue) => { | |
return newValue[primarykey] === old[primarykey]; | |
}); | |
}); |
Create ~/.ssh/github folder
ssh-keygen -t rsa -b 4096 -C '[email protected]' -f ~/.ssh/github/personal -q -N ''
docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer |
let date = new Date(); | |
let offset = 19800; | |
console.log(parseInt(date.getTime() / 1000)); | |
console.log(date.getTimezoneOffset()); | |
console.log(date.toISOString()); | |
let _offset = 28800 * 1000 | |
console.log(_offset); | |
date.setTime( date.getTime() - (offset * 1000) + _offset ); | |
console.log(date.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true }), _offset,date.getTimezoneOffset(), date.getTimezoneOffset() * 60 * 1000); |
import json | |
import os | |
import requests | |
import threading | |
import time | |
class Manager: | |
server = os.getenv('GATEWAY_URL', "http://p1007.local:8080") |
#sudo bash expand-pi-image.sh <img-file> | |
#sudo setup-chroot.sh <img-file> | |
#run changes and type exit | |
if [ "$1" ]; then | |
real_file_path=`realpath "${1}"` | |
echo "Img File: ${real_file_path}" | |
dd if=/dev/zero bs=1M count=1024 >> $real_file_path | |
sudo kpartx -v -a $real_file_path | |
loop_device=`losetup --list | grep "${real_file_path}" | cut -d ' ' -f1 | cut -d'/' -f3` | |
echo "Loop Device => /dev/${loop_device}" |
if [ "$1" ]; then | |
sudo kpartx -v -a $1 | |
loop_device=`losetup --list | grep "2021-02-02-raspbian-lite.img" | cut -d ' ' -f1 | cut -d'/' -f3` | |
mapper_loop_device="/dev/mapper/${loop_device}p" | |
echo "Mapper device => ${mapper_loop_device}" | |
echo "Mounting to => `ls /mnt`" | |
sudo bash chroot-to-pi.sh $mapper_loop_device | |
sudo kpartx -d $1 | |
else | |
echo "Please Provide img file" |
#!/bin/bash | |
# This script allows you to chroot ("work on") | |
# the raspbian sd card as if it's the raspberry pi | |
# on your Ubuntu desktop/laptop | |
# just much faster and more convenient | |
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689 | |
# make sure you have issued |
# raspbian stretch lite on ubuntu
### You can write the raspbian image onto the sd card,
# boot the pi so it expands the fs, then plug back to your laptop/desktop
# and chroot to it with my script
# https://gist.github.com/htruong/7df502fb60268eeee5bca21ef3e436eb
# sudo ./chroot-to-pi.sh /dev/sdb
# I found it to be much less of a pain in the ass and more reliable
# than doing the kpartx thing