This file contains 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
<?php | |
$book = 'Some Text Is Here Text Is Text Text characters'; | |
$book_words = explode(" ", $book); | |
$counted_words = array(); | |
foreach ( $book_words as $word ) { | |
if ( array_key_exists($word, $counted_words) ) { | |
$counted_words[$word]++; |
This file contains 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
rsync single directory across two disks. rsync stops when first disk is full, then run rsync -n to see whats remaining, pipe to rsync again to finish on another disk | |
rsync -av /storage/ /mnt/disk1/ | |
... of of space ... | |
rsync -av -n /storage/ /mnt/disk1/ | while read LINE; do rsync -av --progress "$LINE" "/mnt/disk2/$LINE"; done | |
This file contains 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
#!/bin/bash | |
# Set brightness via radeon_bl0 when redshift status changes (amdgpu,radeon) | |
### Set brihtness via xbrightness when redshift status changes | |
# Set brightness values for each status. | |
# Range from 1 to 255 is valid | |
brightness_day="255" | |
brightness_transition="120" |
This file contains 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
# Pair of script for encrypt and decrypt directories using AES | |
#encrypt.sh | |
#!/bin/bash | |
wd=`pwd`; | |
if [ -z "$1" ]; then echo "./encrypt.sh <foldername>"; exit 1; fi | |
indir=$1 | |
out=$wd/ |
This file contains 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
#!/usr/bin/env bash | |
# Simple cpu test in bash | |
# Number of threads | |
numthreads=64 #Changing this will affect results | |
#Addition | |
function count() { |
This file contains 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
#!/usr/bin/env bash | |
# Software entropy generator | |
seed=1024 | |
function output() { | |
base64=`echo "obase=64;$1" | bc | cut -c8-9` | |
case $base64 in | |
00)letter=a;; |