Skip to content

Instantly share code, notes, and snippets.

View DaWe35's full-sized avatar

DaWe DaWe35

View GitHub Profile

Download Backblaze snapshot to remote with cURL cli.

Since the download URL is only accessible if you are signed in, and accessing the snapshot with s3 is also not possible for some reason, your only option is to make a request to the download URL with the same authentication headers you have on your personal computer. In this example we'll copy the whole download request as a cURL command from the Chrome inspector:

  1. Log in to Backblaze in your browser, and head to the Snapshots page.

  2. Open the inspector (F12) and go to the "network" tab.

  3. Start downloading the file (you can cancel it immediately)

@DaWe35
DaWe35 / stable-diffusion-gc.md
Created March 3, 2024 03:43
Stable diffusion setup on Google Cloud Instances

Install

  • Get a Gcloud instance with GPU and Debian 12 (spot instances are cheaper but can be interrupted)

  • Add a VPC firewall rule to enable 7860 port. Add this rule to the Compute Instance (edit -> networking)

  • Open a screen: screen. It is always a good idea to use screen, because if the connection interrupts, it will preserve the opened process. Next time when you connect, type screen -r to reopen or screen -rd to force reopen after an interruption.

  • Install and verify GPU driver:

@DaWe35
DaWe35 / monerod-sync.md
Last active February 25, 2024 14:32
Monero sync modes

Sync modes

Full node

Download, verify, and store the whole blockchain

monerod --fast-block-sync=0

Fast sync

@DaWe35
DaWe35 / ssh-push.txt
Created January 17, 2024 06:17
Git push with SSH key
# generate an SSH key pair
cd repository
git config --add --local core.sshCommand 'ssh -i /home/user/.ssh/ssh_key'
git push
@DaWe35
DaWe35 / SCP and rsync commands.md
Last active July 10, 2023 13:55
SCP and rsync commands

Copy local file to remote server using SSH key

rsync --compress --archive --partial --append-verify --verbose --progress -e "ssh -i ~/SSH_KEY" LOCAL_FILE.zip REMOTE_USER@REMOTE_IP:REMOTE_FILE.zip

scp -i ~/SSH_KEY LOCAL_FILE REMOTE_USER@REMOTE_IP:REMOTE_FILE.zip

@DaWe35
DaWe35 / Win11-context.md
Last active February 15, 2023 12:50
Windows 11 new context menu customization

If you like the design and the speed of the new context menu, but you find it useless, I have good news for you: you can customize it and make the new Win11 context more personalized.

Remove unused items

To remove unused items, you must remove items from the registry. You'll find some items in these folders, but you can also search for specific items you see in the context menu.

HKEY_CLASSES_ROOT\Folder\shell\ (Do NOT remove opennewwindow - it is required for file explorer to work on your windows tray.)

HKEY_CLASSES_ROOT\exefile\shellex\ContextMenuHandlers\

@DaWe35
DaWe35 / Debug metamask communications.js
Last active June 8, 2022 23:01
Open a web3 webpage, open console and enter this listener so it will log the communication between the site and Metamask.
onmessage = event => {
console.error('Metamask:', event.data.data.data)
}
<script>
jQuery(document).ready(function($) {
function checkFunction(color) {
console.log(color);
var x = $("li." + color);
var exists = false;
for (var i = 0; i < x.length; i++) {
if($(x[i]).hasClass("active")) {
/*
1) Open https://popcat.click
2) Open console (F12)
3) Insert code & run
*/
var event = new KeyboardEvent('keydown', {
key: 'g',
ctrlKey: true
@DaWe35
DaWe35 / my_ubuntu_config.md
Last active January 28, 2022 09:52
Make my Ubuntu more awesome