Bash

create_photo_md

create_photo_md

#!/bin/bash

# Set the directory you want to list files from
directory="/home/ag/jkdev/minimal/assets/images/"

# Set the output file
output_file="/home/ag/jkdev/minimal/foto_raw.md"

# Check if the directory exists
if [ -d "$directory" ]; then
  # Clear the output file if it exists, or create it if it doesn't
  > "$output_file"
 echo §directory $output_file 
  echo "---
layout: single
toc: true
title: Fotos_raw
permalink: /fotosraw/
---
" > "$output_file"
 echo "check" 
  # Iterate through each file in the directory
  for file in "$directory"/*; do
    if [ -f "$file" ]; then
      # Extract and write the filename to the output file
      filename=$(basename "$file")
      filename_without_extension="${filename%.JPG}"
      echo "## $filename_without_extension" >> "$output_file"
      echo "![$filename_without_extension](/assets/images/$filename) " >> "$output_file"
    fi
  done
  echo "File names in $directory have been written to $output_file"
else
  echo "Directory not found: $directory"
fi
 

create_script_md

create_script_md

#
#!/bin/bash

# Set the directory you want to list files from
directory="/home/ag/jkdev/minimal/assets/scripts/"

# Set the output file
output_file="/home/ag/jkdev/minimal/script_raw.md"

# Check if the directory exists
if [ -d "$directory" ]; then
  # Clear the output file if it exists, or create it if it doesn't
  > "$output_file"
 echo §directory $output_file 
 echo "check" 
  # Iterate through each file in the directory
  for file in "$directory"/*; do
    if [ -f "$file" ]; then
      # Extract and write the filename to the output file
      filename=$(basename "$file")
      filename_without_extension="${filename%.JPG}"
      echo "## $filename_without_extension" >> "$output_file"
      echo "[$filename_without_extension](/assets/scripts/$filename) " >> "$output_file"
      echo '```bash'  >> "$output_file"
      echo "{% include /scripts/$filename %} " >> "$output_file"
      echo '```' >> "$output_file"
    fi
  done
  echo "File names in $directory have been written to $output_file"
else
  echo "Directory not found: $directory"
fi
# 
 

record_cp_temp

record_cp_temp

#! zsh
p="$(vcgencmd measure_temp)"
datetime="$(date +'%Y-%m-%d %H:%M')"
echo $datetime $p[6,9]
 

strip_exif

strip_exif

#!/bin/bash

# Set the directory you want to process
directory=$PWD

# Set the command you want to execute on each file
command_to_execute="convert"

# Check if the directory exists
if [ -d "$directory" ]; then
  # Iterate through each file in the directory
  for file in "$directory"/*; do
    if [ -f "$file" ]; then
      # Execute the command on the current file
      $command_to_execute "$file" -strip "$file"
    fi
  done
else
  echo "Directory not found: $directory"
fi

 

update_jekyll_page

update_jekyll_page

cd /home/ag/jkdev/minimal
sudo rm -rf /var/www/html/*
echo "var/www/html cleaned"
create_photo_md
create_script_md
echo "created fotosraw from all image files"
bundle exec jekyll build
echo "jekyll built page"
sudo cp -r _site/* /var/www/html/
echo "copied files to /var/www/html"
echo "------------------------    FINISHED   ---------------------"
 

Python

AI

Web

Other