Code Monkey home page Code Monkey logo

linux-scripts's Introduction

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.

linux-scripts's People

Contributors

tinram avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.