https://github.com/tinram/linux-scripts
Desktop icon restore, ELF overview, OOM protect.
https://github.com/tinram/linux-scripts
desktop-icons elf elf-parser icon oom
Last synced: 3 months ago
JSON representation
Desktop icon restore, ELF overview, OOM protect.
- Host: GitHub
- URL: https://github.com/tinram/linux-scripts
- Owner: Tinram
- License: gpl-3.0
- Created: 2018-06-20T14:36:25.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-10T22:12:52.000Z (over 5 years ago)
- Last Synced: 2025-01-25T12:41:48.291Z (5 months ago)
- Topics: desktop-icons, elf, elf-parser, icon, oom
- Language: Shell
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
./elf_overview.sh | 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
```bash
python3 icon_save
```or
```bash
./icon_save
```#### Restore icons from bash script
+ ensure Desktop 'Auto-arrange' is off
```bash
./icon_restore
```+ show Desktop
+ press F5---
## License
Scripts are released under the [GPL v.3](https://www.gnu.org/licenses/gpl-3.0.html).