DLSR Camera versus Mobile Phone

Last Updated or created 2023-01-08

Not talking about the quality but how much we are using the camera’s.

Reason for taking pictures:

  • Capture memorable events – DLSR
  • Simple snapshots to remember stuff – Mobile
  • HQ photos – shoots etcetera – you want to use DOF, a mobile can´t do this
  • Images for web/mattermost/whatsapp – mobile phone is sufficient

But we always take our phone with us … sometimes we forget to bring the Nikon to memorable events.

A simple count of pictures on my fileserver.

# Below creates a CSV file
for f in $(seq 2000 2022) ; do echo -n $f, ; find  */$f -type f 2>/dev/null | wc -l  ;done 

Notes:

2010 – We bought a new nikon
2019 – Busy planning buying a new house
2020,2021 – Covid
< 2010 – Mobile pictures are potato quality

I had my first android phone in 2009.
Phones before 2010 didn´t have good exif information, so the picture count is a little off in the graph above.

Things in movies that bug me

Last Updated or created 2023-08-07

Will add more

I love movies, but somethings bug the hell out of me.

I often see movie mistakes, but when those mistakes are not too obvious, i can live with it.

Glasses being flat

They could have used glasses which are a little curved, so it isn’t too obviously flat.

But a better solution is :

Dustin Hoffman had to wear contact lenses so that he could see correctly through the thick glasses he had to wear.

The Wilhelm scream

I know it’s a running gag, but it’s not funny anymore.
https://en.wikipedia.org/wiki/Wilhelm_scream

People not really tied up, or pinned down

I hate seeing people tied up badly in movies, so easy to escape. Sometimes the actor has to hold the rope in place to keep it from falling off.
Rope, zipties and chains. (I will add some examples)
In some older movies you can see straining on wrists or neck. So it was really secure and tight! (real)

Bad example i know, but first one i found
Update 20230808 .. Oh no! I can’t escape!
Hover foot

American unrealistic events

Not talking about sci-fi or adventure movies.
Over the top movies. That’s why i like murder mysteries from Iceland, Scandinavia more than American.
There are many movies, in which the main character is the average joe, but he can fall off buildings, hit by cars, and run all day without getting tired. And escapes after that in the most improbable way.

Same category as Wilhelm Scream, the squeaky gate/door

We’ve been using the same sound in our student place 25 years ago.
I even recorded new and better examples for people to use.

Xfiles, sparatacus blood & sand, Supernatural, Shawshank Redemption, Reign of Fire, Final Destination, Quantum Leap, Fringe, etc etc

UPDATE: 20230716 The sound ..

My recording

One of my recordings (Scotland 2022)

Not consulting an expert

Movies about science, computers or even general laws of physics are more believable when asking an expert for advice to portray something.

Lights in diving masks/space helmets

When doing this the diver can’t see sh*t

Spaceships are alway the same orientation, on the same plane, when they meet.

There is no up / down whatever in space. Directors are always thinking of one plane.
Therefore you need to have at least 4 to be “surrounded” in space. 🙂

Not finishing drinks

Maybe i’m cheap. I won’t leave a glass untouched.

Hanging up on phone calls without saying anything like goodbye

Just rude.

People driving looking for minutes at the passenger, not looking at the road

Even worse, moving the steering wheel left right left .. even on a straight road.

Every 555 number has been used 100’s of times

All persons have a number in the range 555-0100 till 555-9999

Rain only being in the place of the actor.

The houses up the street are dry and in the sun

Generic stuff

  • Daylight when needed is in full swing in 2 minutes.
  • Hero’s are still looking at the end-battle scene when officials arrive
  • Bomb are always in the last 10 seconds defused.
  • Hero has to fight lots of people before ending up at the boss, who is stronger than all his minions!
  • People destroying their phone to avoid tracking.
    Take out simcard and destroy, take out battery and destroy then stamp on the phone and throw in the sea.
    Take out the battery if possible, dunk in water else

Fast search ‘n sorting on my fileserver

Last Updated or created 2023-01-05

When i’m looking for certain files on my fileserver i sometimes have to fallback to locate.

Most of the times i use the methods mentioned in :
https://www.henriaanstoot.nl/2022/08/04/finding-files-on-my-fileserver/

The script below helps me to copy located files to a temporary directory.
(Which is excluded in al kinds of other find tools)

It will remove the slashes in a path, but keeps the rest.

  • You can pipe to this script
  • All files in 1 directory, but NO overwrite of files (keeps path). This allows for easy browsing with a picture viewer.
  • Want to know original path, look at the filename .. think of where the slashes should go

Example:

Lets find all jpg’s which linux in its name

# this will list all found files
locate -i linux | grep -i jpg$ 

output example (see below) (With slashes and spaces)
/tank/WorkDirectory/TMP/UITZOEKEN/cds uitzoeken/div/141/31/cd3/done/gfx/linux-from-scratch.jpg

cplocatescript

#!/bin/bash
mkdir -p /mnt/private/TEMP/$$
cat - | while read line ; do cp "$line" /mnt/private/TEMP/$$/$(echo "$line" | tr -cd 'A-Za-z0-9._-' ; echo "" ) ;done

When running combined command:

locate -i linux | grep -i jpg$ | cplocatescript

It will create a directory like below

ls /mnt/private/28723/
fileserverHenri__newsort__WorkDirectory2018_ltstufffromlaptopsnew_uitzuitzoekenWERKDIRECTORY-DEC-2010cd6wwwhtdocsworklinux-project14l.jpg
fileserverHenri__newsort__WorkDirectory2018_ltstufffromlaptopsnew_uitzuitzoekenWERKDIRECTORY-DEC-2010cd6wwwhtdocsworklinux-project14s.jpg
tankWorkDirectoryTMPUITZOEKENcds-uitzoekendiv14131cd3donegfxlinux-from-scratch.jpg
tankWorkDirectoryTMPUITZOEKENcds-uitzoekendiv17166dataUNISONBACKUP_TO_HOMEUNISON_DONELINUX_FROM_SCRATCH.JPG
tankWorkDirectoryTMPUITZOEKENcds-uitzoekendiv982datalinux-presentatiespresentatie.hp.nllinux_cd_deel3Imagescdromtitel.jpg
etc ...
etc ...
etc ...

Bash tips part 1

Last Updated or created 2024-02-13

Best Practices

#!/bin/bash     # Set shebang .. interpreter (sh/python/bash)
#set -x            # debug flag, shows all output and variables
set -e             # exit when an error occurs, Dont use this when sourcing a scriptor using bash ./scriptnaam gebruikt. 
set -u             # exit when a variable isn't defined
set -o pipefail # exit when a pipe command fails
# Add comments to your scripts!

PIPEFAIL Example
grep string /nonexistenddir/file | sort # Does NOT give an error, sort works!
So echo $? gives 0
When set -o pipefail is set, above example will print 1 or 2

Bash options example

#!/bin/bash

usage ()
{
    echo >&2 "usage: $0 <list-of-options>"
}

main ()
{
    [ $# -lt 1 ] && usage
    INSTALL_DIR=`dirname $0`
    for i in $@; do
        echo "$INSTALL_DIR $i"
    done
    
}

main $@

Execute output from a script.

Sometimes i write scripts which print the command I want to have executed. Most of the times to check the generated commandline.
simple example

ls | grep 2000 | while read ; do echo rm -f "$REPLY" ;done

Above only prints the lines
rm -f <filename with 2000>
rm -f <other filename with 2000>

Instead of removing the echo command, you can add a | bash , to have it executed.

ls | grep 2000 | while read ; do echo rm -f "$REPLY" ;done | bash

Or even shorter ( Use !! for previous command )

!! | bash 

History

Search with CTRL-R in your command history, and use !<number> to execute this command again.

touch file1 file2 file3 file4
chmod 664 !* # will chmod only the files

When you used typed
systemctl stop httpd
and want to start again use replace
^stop^start
This will take previous command containing stop and places stop with start and executes this.

Toggle history on/off with “set -o history”, depending on your setup you can use “<space>command to be executed”

History log original username per date when sudo is being used
(creates .history.20230103.fash in /root/ )

HISTFILE=~/.history.$(date +%y%b%d).$(who am i | awk '{ print $1 }')

Skip first 2 lines and join 2 lines

#skip 2 lines
tail -n +3

#join 2 lines
sed 'N;s/\n/,/'

#3rd line from a file
sed "3q;d" /etc/hosts

#join on line line using comma's
paste -sd "," -

Find Tricks

#Remove empty directories
find ??? -empty -type d -delete

#Find multiple extentions
find archieven/ \( -name "*.png" -o -name "*.xml" \)
-print0 to handle filenames with spaces

Remove huge directory structures FAST

mkdir /tmp/empty ; rsync -a --delete /tmp/empty /path/blah

Check program installed and in path

which zenity >/dev/null 2>/tmp/err || ( echo "zenity not found, please install" ; exit 1 )

Change directory to location script for relative path usage

cd $(dirname $0)  
ls relativesubdir/

IFS (Internal Field Separator)

IFS=$' '     # internal field separator, strings split here
for f in $(cat /etc/hosts) ; do echo $f ;done
#outputs 127.0.0.1
#        localhost
IFS=$'\n\t'     # internal field separator, split end of line
for f in $(cat /etc/hosts) ; do echo $f ;done
# Outputs 127.0.0.1 localhost 

Difference for and while read example

echo "This will print every word" > text  # Places text in file
echo "second line" >> text                # Append text
for f in $(cat text) ; do echo $f ;done   # for example
This 
will
print 
every
word
second
line

cat text | while read f ; do echo $f ; done # Read example
This will print every word
second line

Correct way to make a tempfile

tempfile=$(mktemp -d -t /tmp/log.$$)    # Temp file, with unique name $$ is the process number

Usage in script :
ls > $tempfile

Cleanup:
rm -f "/tmp/$tempfile"    # Remove

Direcory empty test

[ "$(ls -A /tmp)" ] && echo "Not empty" || echo "Empty" # test directory Empty/filled
test -d /tmp/1 && rmdir /tmp/1           # Removes a directory when it exists, will give an error when NOT empty

Using Expand

On directories archive30_tmp till archive35_tmp setting recursive chmod 2775 

find achief{30..35}_tmp -type d -exec chmod 2775 {} \;
 
or
 
mkdir tmp{1..3} # will create tmp1 tmp2 tmp3

echo pr{ut,utser}s # Outputs "pruts prutsers"

Test root user

if [ $USER == "root" ] ; then … ; fi # execute only when root
if $USER is empty, this will give an error.

if [ w$USER == "wroot" ] works 
qouting $USER also, but qouting a number using less/greater test could be problematic

Mount test

grep -qs /media /proc/mounts && echo "/media is mounted"

Date tricks

datum=$(date +%Y%m%d)                    # datum is yyyymmdd 20230103
today=$(date +%F)
tomorrow=$(date --date="next day" +%F)
p3=$(date --date="$p2" +%F)
dater=$p3
#now=$(date +%s --date="1 days ago")
now=$(date -d $(date --date="1 days ago" +%F) +%s)
p3epoch=$(date --date="$p3" +%s)
dater=$(date -d "$p3 1 year" +%F)

date -d @<UNIX timestamp> # Timestamp to date

Size test in directory

if [ "$(df /tmp |grep -v Available | awk {' print $4 }')" -lt 1000000 ] ; then echo "not enough free in /tmp" ;fi  

Parallel Tasks

4 parallel jobs  
find jpg -type f -name \*.jpg -print0 | xargs -0 -n1 -P4 ./convert.sh

Cluster ssh trick

Using Clusterssh at work
## clusterssh trick
Only needed to do stuff on server having a certain directory

    clusterssh storageservers # ssh to 24 storage servers
    sudo su -
    cd /bricks/*/backup2 # change directory to this if exists
    cd /alternatedir/brick0*/backup2 # change to this alternate directory if it exists 
# directories not found? then you are still in /root
    pwd | grep testdir || logout # no testdir in found subdirs? (there are non in /root so you will be logged out)
    id | grep myuser && logout # if mortal user? then logout again .. you will be disconnected from servers not containing the backup2 directories
    Do your work as root 

Forgot to sudo?

systemctl restart httpd (wont work as user)
sudo !!
(this will do  "sudo systemctl restart httpd")

Top 5 homedir users

du -hsx /home/* | sort -rh | head -5

Removing a huge file takes a long time .. lets truncate it

: > hugefile
rm hugefile

Check memory banks using dmidecode

sudo dmidecode| grep  -i -B1 "Form Factor" (B1 means BEFORE 1 line, A is AFTER)
 
        Size: 8192 MB
        Form Factor: DIMM
--
        Size: 8192 MB
        Form Factor: DIMM
--
        Size: No Module Installed
        Form Factor: DIMM
--
 
sudo dmidecode -t memory | grep -i size
        Size: 4096 MB

--
sudo lshw -short -C memory
H/W path            Device      Class          Description
==========================================================
/0/0                            memory         96KiB BIOS
/0/1000                         memory         4GiB System Memory
/0/1000/0                       memory         4GiB DIMM RAM

Script log replay

    script --timing=/tmp/time.txt /tmp/script.log
start your script
    scriptreplay -t /tmp/time.txt /tmp/script.log
replays

Deleted file takes up disk space (not being released)

lsof

httpd 12209 root 6w REG 253,3 5233639424 2097234 /var/log/httpd/access_log-20200711 (deleted)

cd /proc/12209/fd

find /proc/12209/fd -ls | grep '(deleted)'

121613145 0 l-wx------ 1 root root 64 Jul 10 12:04 /proc/12209/fd/6 -> /var/log/httpd/access_log-20200711\ (deleted)

: > "/proc/12209/fd/6"                 # Truncate

Keyword in line grep

cat file | grep -o 'skip_reason.*' # till end
cat file | grep -o 'skip_reason.*tillhere' 

Remove space filename

mv *\ * a 
rm *\ * 

Upper to lower case

 tr '[:upper:]' '[:lower:]'

Whole directories to lowercase

#!/bin/bash
#print usage 
if [ -z $1 ];then
        echo "Usage :$(basename $0) parent-directory"
        exit 1
fi

#process all subdirectories and files in parent directory
all="$(find $1 -depth)"



for name in ${all}; do
        #set new name in lower case for files and directories
        new_name="$(dirname "${name}")/$(basename "${name}" | tr '[A-Z]' '[a-z]')"

        #check if new name already exists
        if [ "${name}" != "${new_name}" ]; then
                [ ! -e "${new_name}" ] && mv -T "${name}" "${new_name}"; echo "${name} was renamed to ${new_name}" || echo "${name} wasn't renamed!"
        fi
done

echo
echo
#list directories and file new names in lowercase
echo "Directories and files with new names in lowercase letters"
find $(echo $1 | tr 'A-Z' 'a-z') -depth

exit 0

Sort by lenght

awk '{ print length(), $0 | "sort -n" }' 

Order / Delimiter AWK

echo 8.168.192.in-addr.arpa. | awk -F  "." '/1/ { print $3,$2,$1 }'

From – Till using AWK

cat file | awk '/Title1/,/-----/' 

Replace Tabs

sed -e 's/\t/ /g'

Sed Case Insensitive

sed s/a/b/gI 

And using lynx std in

cat index.html | lynx --dump -stdin

Random sleep

sleep .$[ ( $RANDOM % 4 ) + 1 ]s
#remove . for whole seconds instead of 10th of seconds

Copy pasting a lot from terminal , use xclip to copy to clipboard

xclip -sel c < bigsourcefile.c

Cache dir in memory for high IO processes

#!/bin/bash
[ ! -d /ramcache ] && mkdir -p /ramcache
mount -t tmpfs -o size=2G,nr_inodes=5k,mode=777 tmpfs /ramcache

Have a dual boot machine? And want to remotely start the other OS?
reboot2windows.sh

WINDOWS_TITLE=`grep -i "^menuentry 'Windows" /boot/grub/grub.cfg|head -n 1|cut -d"'" -f2`
sudo grub-reboot "$WINDOWS_TITLE"
sudo reboot

Move files in subdirectory per create hour

for f in $(seq -w 0 23) ; do find . -type f -print0 | xargs -0 -r stat -c "%y %N" | grep -E " $f:" | cut -f2 -d\' | while read ; do mkdir -p $f ; mv "$REPLY" $f/ ; done ;d

Boardgames

Last Updated or created 2023-01-05

Don’t know what game to buy?
Head over to boardgamegeek.com

Ratings, wiki, manuals, reviews, forum and more
Get you own collection list online

Our list is here
Link https://boardgamegeek.com/collection/user/fashice

My top 5 games (at the moment) are:

  • Uboot
  • Memoir ’44
  • Monster Slaughter
  • Lord of the Rings
  • Codenames Duet

U-BOOT: The Board Game is a fully cooperative, real-time tabletop game of WW2 submarine warfare. It allows 1 to 4 players to assume the roles of the Captain, the First Officer, the Navigator, and the Chief Engineer on board of a type VIIC U-boat. The game is driven by a companion app, allowing for an unprecedented level of realism, as well as a challenging enemy A.I. which will push your skills to the limit. The action unfolds both on the strategic and the tactical scale, always demanding teamwork, efficient crew management, and quick situation assessment.

Uboot game with own 3D printed submarine with leds

Memoir ’44 is a historical boardgame where players face-off in stylized battles of some of the most famous historic battles of World War II including Omaha Beach, Pegasus Bridge, Operation Cobra and the Ardennes. The game includes over 15 different battle scenarios and features a double-sided hex game board for both beach landings and countryside combat. Each scenario mimics the historical terrain, troop placements and objectives of each army. Commanders deploy troops through Command and Tactic cards, applying the unique skills of his units — infantry, paratrooper, tank, artillery, and even resistance fighters — to their greatest strength.

Monster Slaughter is a tactical game inspired by horror movie classics, where each players takes control of a family of three monsters: father, mother and child, each with their own stats and family power. Their objective is to scour the cabin looking for five guests, find their hiding spot and “take care” of them! Each victim hides in a pile of cards that monsters must search through to find them, gathering items and traps as they do. Once revealed, a guest’s miniature is put on the board and can be attacked!

However, each player has secretly set a killing order for these guests, and killing them in order is worth more points. They can use their item cards to defend the guests against other monsters or scare the victims away to other rooms, so the guests die in a more favorable order!

Monster Slaughter

Some DIY own build games are:
Shogi (Japanese Chess)
https://www.henriaanstoot.nl/2012/05/31/shogi-game-lasercut/
Crokinole (Canadian game)
https://www.henriaanstoot.nl/2018/06/14/made-a-crokinole-game/

ChatGPT IA generated chats/texts

Last Updated or created 2023-01-05

ChatGPT is a large language model chatbot developed by OpenAI based on GPT-3.5. It has a remarkable ability to interact in conversational dialogue form and provide responses that can appear surprisingly human.

So i asked stuff like:

Thats a pretty good joke about a 6502 CPU. I tought it would be a hard question

The question : “what are women looking for in a man”
Gave a lot of lines :
No generic answer
Lines with Respect, Humor, Kindness, Confidence

Then it stopped with:

Typical .. even AI is baffled by women.

Below a chat session from a great friend of mine Tyrone

Tyrone: Ok could you write me a commodore c64 assembly routine to make the screen white?

Certainly! Here is a simple assembly routine that will clear the screen and set all of the pixels to white on a Commodore 64:

Copy code

ldx #$00
ldy #$00 
clear_screen: 
sta $d800,x 
inx 
cpx #$40 
bne clear_screen 

This code will loop through all of the screen memory locations and set the value at each location to $00, which will turn all of the pixels white. The inx and iny instructions are used to increment the X and Y registers, which are used to keep track of the current screen position. The cpy instruction is used to compare the value in the Y register to $20, and the bne instruction is used to branch back to the clear_screen label if the values are not equal, causing the loop to continue until the entire screen has been cleared.

I hope this helps! Let me know if you have any questions.



Tyrone: Well a big code but i wanted to make the screen the color white not with a character space .. this is also white but it's more logical that the color is named then the white space this code should be three lines of could can you do this?

Certainly! Here is a simple assembly routine that will clear the screen and set all of the pixels to white on a Commodore 64:

Copy code

ldx #$00
ldy #$00 
clear_screen: 
sta $d800,x 
inx 
cpx #$40 
bne clear_screen 

This code will loop through all of the screen memory locations and set the value at each location to $ff, which will turn all of the pixels white. The inx instruction is used to increment the X register, which is used to keep track of the current screen position. The cpx instruction is used to compare the value in the X register to $40, and the bne instruction is used to branch back to the clear_screen label if the values are not equal, causing the loop to continue until the entire screen has been cleared.

I hope this helps! Let me know if you have any questions.



Tyrone: This is wrong here is a hint use registers d020 and d021 for screen and border color 

I apologize for the mistake in my previous response. Here is the corrected code that will set the screen and border colors to white on a Commodore 64:

Copy code

lda #$0f
sta $d020
sta $d021 

This code will store the value $0f in the memory locations at $d020 and $d021, which are the registers that control the screen and border colors on the Commodore 64. The value $0f corresponds to the color white.

I hope this helps! Let me know if you have any questions.



Thank you ai 

Weird comix, doodles and drawings i did

Last Updated or created 2023-07-20

Blind parents often think their children are blind due to genetics.
Miffy learns DNS (Domain Name resolving)
Biological fly fly swatter trap

Here comes the plane!! ..
Fear for flying learned at a young age
More realistic spiderman

Postman, please drop some catfood in the mailbox every day?
Stopcontact = powersocket, spijkers = nails, aquariumslang met water = hose with water, lampje = lamp and using a clothespin to turn light off or dimming it
If you know .. you know
Waldorf and Statler (Vincent and me)
A friend and I having both backpains, mixing pills and alcohol will do the trick? Made a blender image to post in our Mattermost channel