Remove all installed Ruby Gems.
Posted in Bash Scripts, Linux on June 18th, 2013 by admin – Be the first to commentThis one liner will remove all of the installed gems on your systems, including all versions.
This one liner will remove all of the installed gems on your systems, including all versions.
Requirements
Highlights
You will need to:
openvas-administrator – 1.2.1-2
openvas-cli – 1.1.5-3
openvas-glib2 – 2.22.5-2
openvas-libraries – 5.0.3-4
openvas-manager – 3.0.3-3
openvas-scanner – 3.3.1-2
greenbone-security-assistant - 3.0.3-3
At work, I recently went on the hunt to improve our existing mongo database backups, it was setup using some script found online that really had no logging, notifications or error handling. Basically, to know whether the backup was successful or not, you would have to logon to verify the dump file existed.
I looked for an existing solution that had all the features one would want in a backup script (such as compression, archiving, exporting, performance throttling etc), but came up empty. I ultimately built an in house solution (mongosback) that’s been working very well, I’ve made it slightly more user friendly for public release.
Highlights
Download on Github – Mongosback
Since most of the ‘what is my ip’ address sites have been making constant changes to prevent wget and curl access, essentially so they can drive traffic to their site for higher ad revenue, I needed an alternative.
So without further adieu, feel free to curl, wget the following address to get your external IP address from the CLI.
As Linux continues to grow in popularity, I come across more and more users, this is always a good thing because I enjoy to discuss Linux naturally. However, I’m consistently running into people who strive for great information, yet aren’t familiar with LWN. I’ve always felt the need to stay as informed as possible on the direction of Linux at the lowest levels, over the years it’s been a very useful asset knowing the caveats of different kernels such as bugs, limitations and new tunable parameters (via /sys /proc sysctl etc.). I used to religiously read the Linux kernel mailing lists, until it grew and grew until the point where sifting through the shear amount of dialoge can be quite a challenge.
After this frustration, a few years ago I setup a LWN.net account which is primary written by the well known Linux contributor Jonathan Corbet with a variety of contributors. There are many free elements to the site, however to take full advantage, you’re going to have to pony up a little bit of money, which goes to support the site, the contributions range from $3.50 per month to $50.00 per month.
LWN aggregates and sorts some of the most important Linux information into one location, they also produce some of the most influential Linux content on the web, many LWN discussions have led to changes made in the Linux Kernel. There is the weekly addition which covers important topics of the week including security alerts, kernel updates, distribution news, development updates (new software releases) also included is Q&A sessions, uniquely generated content and more.
I may sound like a pitchman, but LWN has served me very well over the years and it may not be for everyone, but it’s certainly worth a shot
There are so many methods to obtain information about a particular process on Linux, however many tools have one specific purpose whether it’s reporting memory, IO statistics on an individual basis. Alternatively, there is also the /proc file system which contains a wealth of information, it too is spread out. I put together ‘pidinfo’ to be a simple tool to grab information from various places and resources and then compiling them into organized results. It’s generates information very quickly and provides insight into a particular process by providing statistics such as cpu usage, memory usage, IO statistics, state, open file descriptors, executor, startup command and so fourth.
I will continue to update it to add more functionality(Download): https://github.com/vigeek/nixutils
Come across this error on occasion when joining a Linux server to a Windows domain using Samba/Winbind, has always been solvable using one of the two methods.
I was recently tasked with putting together a service wrapper for opentaps, unfortunately the official service wrapper and third party solutions are quite basic and generally just execute startofbiz.sh without anyway to legitimately determine whether the service is correctly running and responding to web requests. Executing the startofbiz.sh shell script simply reports “starting ofbiz”, it’s up to you from that point to determine whether or not the start succeeded, I wanted something more robust than this. This company in particular generates significant income on their website and heavily utilizes opentaps, some of the users executing this script would be junior level administrators therefore it was import for this script to take a lot of the guess work on what opentaps/ofbiz is doing during the start/stop phase.
The Script
Note: There are two versions of this script (I’ll be posting the other soon), one wraps around the existing stop/start scripts for opentaps/ofbiz. The other completely replaces it. Both achieve the same result.
Details: We essentially use CURL to determine whether the service is running, CURL will make a header request, if the header request delivers the desired results, it’s online and responding. Else, it’s offline. Depending on your server performance you may need to adjust the connect-timeout, but in virtually every case the default (2) should suffice.
Features:
Functions:
Installation
(Assumes you’re using RHEL/CentOS)
Chances are if you’ve worked with mySQL for a while, you’ve probably ran into Error #1071 or ‘Specified key was too long; max key length is 1000 bytes’, There seems to be a high degree of confusion regarding this error message, I’ve typically ran into this error while exporting/importing databases from different systems. i.e I’ve taken a development mySQL dump and tried importing it into our staging mySQL server.
This error is typically a relatively easy fix and unfortunately this resolution is not easy to find.
Stop mySQL
Change into default mySQL data path (usually: /var/lib/mysql).
Delete both ib_logfiles (ib_logfile0 & ib_logfile1 etc).
Now simply start up mySQL and the issue should be resolved.
You’re probably wondering, why the hell do I need this? In my case our development team releases a patch that has some SQL changes that inevitably slow our mySQL cluster down to a crawl. I was given the task of finding a temporary solution while the developers worked on a fix. The solution would be, we go through the process list and kill queries that have been hung for X. Instead of reinventing the wheel, I came across a solid Perl script from ‘spe’ which achieves this task, I added some additional functionality and updated some existing functions.
This script will simply go through the process list, identify slow running queries and then kill them. The threshold and alert options are configurable.