Skip to content

Tinram/Linux-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux Scripts

Linux utility scripts.


elf_overview.sh

Purpose

Output a simple overview of an ELF executable through the calling file, readelf, hd, size, objdump, ldd, and strings. This is easier to run than remember the command-line switches, while some tools (objdump and readelf) can produce subtly similar outputs.

Another use of elf_overview.sh is to verify that files such as PDFs are authentic and not masquerading as executables.

Usage

    ./elf_overview.sh <file> | less

OOM_protect.sh

Purpose

Protect a critical application from being killed first by the Linux kernel's OOM Killer.

Description

  1. The critical app on a limited-budget web server might be MySQL.
  2. A runaway PHP script, operating through an Apache process, triggers the OOM.
  3. But MySQL – using the most memory – is ungracefully killed first, before Apache. The untimely death of MySQL creates database and sales problems.

OOM_protect.sh aims to stop the above happening.

(So might the database and web server residing on separate servers.)

Usage

  1. chmod 700 OOM_protect.sh

  2. set APP variable path in the script's CONFIG section.

  3. sudo ./OOM_protect.sh


icon_save

Purpose

Gnome / Nemo desktop icon position restore.

Description

A Python script to generate a bash script recording desktop icon positions. When desktop icon positions are lost, such as through connecting/disconnecting a second monitor or enacting 'Sort Desktop items by Name', executing the bash script restores the icon positions.

Usage

Place script in ~/Desktop folder.

Create bash script

    python3 icon_save

or

    ./icon_save

Restore icons from bash script

  • ensure Desktop 'Auto-arrange' is off
    ./icon_restore
  • show Desktop
  • press F5

License

Scripts are released under the GPL v.3.

About

Desktop icon restore, ELF overview, OOM protect.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published