sudo pacman -S xautolock slock dunst
xautolock runs slock - a simple screen locker - after no input has been detected for 5 minutes.
| #!/bin/bash | |
| # Exit on any error | |
| set -e | |
| echo "Starting Hackatime setup..." | |
| # Step 1: Check if config directory exists and create if needed | |
| WAKATIME_CONFIG_DIR="$HOME" | |
| WAKATIME_CONFIG_FILE="$WAKATIME_CONFIG_DIR/.wakatime.cfg" |
| #!/usr/bin/env bash | |
| # USAGE: serversetup.sh <NEW_USERNAME> <IP> | |
| DESIRED_REMOTE_USERNAME=$1 | |
| EXISTING_REMOTE_USER=root # Assumes you already have a key for for root on your machine. | |
| REMOTE_IP=$2 | |
| KEY_NAME=id_ed25519_$(echo $REMOTE_IP | tr . -) | |
| LOCAL_KEY_LOCATION=$HOME/.ssh/$KEY_NAME |
| #include <stdio.h> | |
| #include <string.h> | |
| int main(int argc, char *argv[]) | |
| { | |
| unsigned char headerBuffer[100]; | |
| FILE *ptr; | |
| ptr = fopen(argv[1], "rb"); |
| fn main() { | |
| println!("Original text:\t"); | |
| let mut line = String::new(); | |
| std::io::stdin().read_line(&mut line).unwrap(); | |
| line = line.trim().to_string(); | |
| let mut last_character = line.chars().next().unwrap(); | |
| let mut character_count = 0; | |
| let mut final_string = String::new(); |
| import sys | |
| def main(): | |
| min_file_name = sys.argv[1].split('.') | |
| min_file_name.insert(len(sys.argv) - 1, "min") | |
| min_file_name = '.'.join(min_file_name) | |
| with open(min_file_name, "w+") as min_file: | |
| final = "" | |
| with open(sys.argv[1]) as src_file: |
| #!/bin/bash | |
| sudo rm /tmp/create_ap.all.lock | |
| sudo lnxrouter --ap wlp1s0 <SSID> -p <PASSWORD> | |
| function finish { | |
| sudo ip link set wlp1s0 state UP | |
| } | |
| trap finish EXIT |
| <script> | |
| import { onMount } from 'svelte'; | |
| import { fly } from "svelte/transition"; | |
| let ready = false; | |
| onMount(() => ready = true); | |
| const dataset = [ | |
| { name: "Apple", price: 6 }, | |
| { name: "Orange", price: 5 }, |
| function endian() { | |
| const uInt16 = new Uint16Array([0x1122]); | |
| const uInt8 = new Uint8Array(uInt16.buffer); | |
| // If the first byte is 0x11, then we are on a big endian system, as they place the most significant byte first. | |
| // (The most significant byte is the byte that has the greatest value.) | |
| if (uInt8[0] === 0x11) console.log("Big endian system"); | |
| // On a big endian system, the most significant byte is first. | |
| // So the first byte is 0x11 (0001 0001) (17) |
| #!/bin/bash | |
| if [ -d "$1" ]; then # If the directory exists | |
| if [ "$(ls -A $1)" ]; then | |
| # The directory exists & contains files | |
| echo "$1 is not empty. Exiting." | |
| exit 0 | |
| else | |
| # The directory exists & is empty | |
| rmdir $1 | |
| fi |