script

A Linux shell script (and commands) to find large files

I made a mistake in configuring logrotate on a new Linux system, and almost ran into a problem because of that. Fortunately I saw the problem before it became a BIG problem, but as a result, I decided to add a script to my Linux system to check for large files, typically log files that have grown out of control for one reason or another.

Here then is a simple Linux shell script I named LargeFileCheck.sh, which searches the filesystem for files that are larger than 1GB in size:

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

A Linux shell script to rename files with a counter and copy them

As a brief note today, I was recently looking for all Messages/iMessage files that are stored on my Mac, and I used this shell script to copy all of those files — many of which have the same name — into a directory named tmpdir, giving them all new names during the copy process:

count=1
for i in `cat myfiles`
do
    fname=`basename $i`
    cp $i tmpdir/${count}-${fname}
    count=`expr $count + 1`
done

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

Gimp “Script-Fu” example (functions, parameters)

I’ve mentioned this before, but if you’re interested in learning Lisp/Scheme programming, the makers of gimphelp.org have a nice collection of plugins for Gimp 2.8 that you can download, and they’re all written in Scheme. (Well, a variation of Scheme.)

Here’s the body of a Gimp plugin file named FU_contrast_auto-contrast.scm:

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

How to list all available LuaLaTeX and LuaTeX fonts (MacTex)

As a quick note, this URL shared a script to list all of the LuaLaTeX font names, and it almost worked for me.

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

A Drupal 8 XML Sitemap generating PHP script

I’m not going to comment on the following code too much or provide support for it, but (a) if you need to create an XML Sitemap for a Drupal 8 website, and (b) you don’t like the Drupal 8 sitemap modules that are available, then (c) this PHP script can serve as a starting point for you.

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

A Scala shell script to move your mouse cursor

I’m currently trying to automate a GUI task, and as a part of that, one thing I need to do is move the mouse cursor.

In short, the solution I came up with was to write a Scala shell script that uses the Java Robot class to move the mouse. Here’s the source code for my script, which I named MoveMouse.sh:

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

How to run a Scala SBT-packaged jar file with Java (the `java` command)

If you want to run/execute a main method from a jar file you created with Scala and the sbt package command, this little tutorial shows how to do it. To make things a little more complicated, my Scala project depends on three external jar files, and the main method requires a command-line argument.

As noted in the Summary, you’ll probably want to use a tool like SBT-Assembly for larger projects.

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.