This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type React from "react" | |
| // MetaMask-style hash function | |
| const hashCode = (str: string): number => { | |
| let hash = 0 | |
| for (let i = 0; i < str.length; i++) { | |
| const char = str.charCodeAt(i) | |
| hash = (hash << 5) - hash + char | |
| hash = hash & hash | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState } from 'react' | |
| import { useSendCalls, ConnectButton, useActiveWallet } from "thirdweb/react"; | |
| import { createThirdwebClient, type ThirdwebClient, prepareTransaction } from "thirdweb"; | |
| import { CHAIN, CLIENT_ID } from './config'; | |
| console.log(CHAIN, CLIENT_ID); | |
| const client: ThirdwebClient = createThirdwebClient({ | |
| clientId: CLIENT_ID, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chown -R "$USER":"$USER" ~/.gnupg | |
| chmod 700 ~/.gnupg | |
| find ~/.gnupg -type f -exec chmod 600 {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pacman -S audit | |
| sudo systemctl enable --now auditd | |
| # track folder | |
| sudo auditctl -w /tmp/custom_folder_to_watch -p r -k custom_test_watch_key | |
| # view access logs | |
| sudo ausearch -k custom_test_watch_key | |
| # list watchers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pacman -S brlaser | |
| pacman -S brscan5 | |
| pacman -S sane |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yay -S gromit-mpx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function extractAndSortPosts() { | |
| // Get all posts | |
| const rows = document.querySelectorAll(".athing.submission"); | |
| const posts = []; | |
| rows.forEach(row => { | |
| // Extract title | |
| const titleElement = row.querySelector(".titleline a"); | |
| const title = titleElement ? titleElement.innerText : "No title"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo pacman -Syu | |
| sudo pacman -S gdm | |
| sudo systemctl enable gdm.service | |
| # disable lightdm if installed | |
| sudo systemctl disable lightdm.service | |
| # (optional) remove lightdm | |
| sudo pacman -Rns lightdm lightdm-gtk-greeter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # edit autostart file | |
| vim ~/.config/autostart/dropbox.desktop | |
| # Add or modify | |
| X-GNOME-Autostart-enabled=false | |
| # completely remove autostart | |
| # rm ~/.config/autostart/dropbox.desktop | |
| # disable service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ethereum_generate_keys() { | |
| # Generate the private key and public key | |
| local key=$(openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout 2>/dev/null) | |
| # Extract and clean the public key | |
| local pub=$(echo "$key" | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//') | |
| # Extract and clean the private key | |
| local priv=$(echo "$key" | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' | sed 's/^priv//') |
NewerOlder