This is a kernel parameter that you can set with /etc/sysctl.conf by adding two lines: # tail -n 2 /etc/sysctl.conf net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.icmp_echo_ignore_all = 1 Apply the changes by using the sysctl -p command: # sysctl -p . . . net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.icmp_echo_ignore_all = 1 # There are various security reasons why you […]
Disable Ping (ICMP) Responses With Linux
Sprogram Terminated Error after Gentoo Emerge
We recently upgraded our Sparc64 Gentoo box. When we rebooted we got an error at the console when trying to boot that just said Sprogram terminated. It turns out that this was caused by an error with the SILO boot records. See this article for more information on installing SILO. To get our system to […]
Upgrading Linux Kernel on Gentoo Sparc64
We had a troublesome upgrade of our Gentoo Sparc64 box. After emerge world the system wouldn’t boot because the boot files were changed without re-running SILO. We fixed this in this article. Anyway, even though we went through this trouble, it appears that the emerge downloaded the 2.4.31 sources, messed with our boot files, but […]
JDK on GNU/Linux on Sparc64
If you need to run Java on GNU/Linux running on Sparc64 hardware, your best bet is to get the Blackdown source. This is easy with Gentoo: srv-1 opt # emerge jdk Calculating dependencies …done! >>> emerge (1 of 2) dev-java/java-config-1.2.11 to / >>> Downloading http://distfiles.gentoo.org/distfiles/java-config-1.2.11.tar.bz2 –10:00:21– http://distfiles.gentoo.org/distfiles/java-config-1.2.11.tar.bz2 => `/usr/portage/distfiles/java-config-1.2.11.tar.bz2′ Resolving distfiles.gentoo.org… 216.165.129.135, 64.50.236.52, 156.56.247.195 Connecting […]
Forcing Installs with Up2date
If you have trouble with dependencies running up2date, the Red Hat update system, you can force download and installs by downloading the packages regardless of dependencies and then forcing the install. Be careful when you do this, or course. The system is there to make sure you install the correct packages, so if up2date tells […]
Rebuilding the RPM Database
Be very careful messing with your RPM database. You can cause serious system failure if you mess up your RPM packages. One trick that works for us is to rebuild the RPM database: [root@www root]# cd /var/lib/rpm/ [root@www rpm]# ls Basenames __db.003 Installtid Provideversion Sha1header Conflictname Dirnames Name Pubkeys Sigmd5 __db.001 Filemd5s Packages Requirename Triggername […]
Crontab Locations on Red Hat, Fedora, and CentOS
On Red Hat/Fedora/CentOS, you can’t simply look at that output of crontab -l to see what is scheduled to run as root, even if you are running as root. For instance: # crontab -l 0 0 * * * /bin/some/command # cat /var/spool/cron/root 0 0 * * * /bin/some/command # There can be another system […]
Listing and Counting Processes with a Certain Name
The -C option can be used with ps to display certain processes: $ ps -C httpd PID TTY TIME CMD 726 ? 00:00:00 httpd 732 ? 00:00:00 httpd 6064 ? 00:00:00 httpd 19452 ? 00:00:00 httpd 21047 ? 00:00:00 httpd 21048 ? 00:00:00 httpd 21049 ? 00:00:00 httpd 21060 ? 00:00:00 httpd 30127 ? 00:00:00 […]
Using Yum To Install Dependencies
Always reluctant to try something new when we are comfortable with the tools we currently use, we haven’t used yum before. We had a problem with installing the net-snmp-devel package with up2date because of some dependencies. We were able to use yum to quickly install the package we needed along with the dependencies on our […]
Embedding Text in Find Output
We recently did a migration of large files to another server, and needed to create a bunch of redirect commands to point at the new location. This turned out to be quite easy with find. First, we need to find the files over 570K: find . -size +570k -printf ‘%k %p\n’ The quotes after printf […]
Setting the Root Password on Ubuntu
There is, generally, no need to use root for Ubuntu, since everything is done via sudo. If you wish, though, you can set the root password by typing: sudo su Enter the user password, and then: passwd Enter the root password you wish to use. Now, you can log on as root if you wish.
Using Strace to Debug Code
We wrote about strace in this article to find the files a program opened. The manpage for strace is here. Strace can be used to debug code as well. We have an application we are writing in REALbasic. In case you haven’t heard of this before, it is a cross platform compiler that is a […]
Logical OR With Grep
Say you have a file that has seventeen entries that look like this: [usr-1@srv-1 ~]$ cat nmapout.txt Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2006-05-05 13:41 PDT Interesting ports on 10.50.100.1: (The 1656 ports scanned but not shown below are in state: closed) PORT STATE SERVICE 22/tcp open ssh 111/tcp open rpcbind 6000/tcp open X11 […]
Substring Replacement With BASH
If you need to rename a substring of a bunch of filenames to something else, use a command like this: for i in server*.html; do mv $i ${i/server/workstation} ; done This changes all serverblah.html files to workstationblah.html. For more on BASH, see the BASH Manpage.
Procinfo
Procinfo gathers system data from /proc and prints it to the screen. The program has been around since the infancy of Linux. There are some patches for procinfo here. Now, Red Hat has been patching this for a long time. Here is a change log for the current patches. The original sources were a bit […]
LVM Support for the Linux 2.4 Kernel – Device Mapper
We decided to build a very small box to serve up an iSCSI target using LVM for the storage device. We used the root filesystem from here, which means that we are starting from a very basic system. We are using version 2.4.32 of the Linux kernel. Do consider Openfiler if you have more sophisticated […]
LVM Support for the Linux 2.4 Kernel – Compiling and Configuring LVM
Now that the device mapper is all happy (see this article), let’s install the LVM software. Grab the source from here. Extract, configure, compile, and install: sv-1# tar -xzf LVM2.2.01.15.tgz sv-1# cd LVM2.2.01.15 sv-1# ./configure –prefix=/usr checking build system type… i686-pc-linux-gnu checking host system type… i686-pc-linux-gnu checking target system type… i686-pc-linux-gnu checking for gawk… gawk […]
Rename and Increment Files with Bash
Doing a visual audit of a data center with a digital camera is a quick and easy way to help get your bearings when assisting remote hands. We have a bunch of pictures we took of our server racks. Notice that some pictures that weren’t very good are already deleted: $ ls IMG_0918.JPG IMG_0925.JPG IMG_0931.JPG […]
Determining GTK Version
We had a program, mcjl, that appeared to run on GTK 2.6, but the vendor said it needed GTK 2.8. To show what libraries the program uses, use ldd: root:~/newmcj# ldd mcjl linux-gate.so.1 => (0xb808d000) libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0xb7daf000) libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb7d43000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb7d3f000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7cbd000) libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7cb8000) […]
Installing GNU/Linux on a MacBook Intel Core 2 Duo – 1
We tried installing Ubuntu 9.04 on our MacBook. That worked OK, but the mouse (touch pad) acted a little bit wonky. Now, when things are wonky, “use the source, Luke!”. At least, dig down enough into the source to tailor to the hardware and just do what you need. NoNIC V3 has a distribution that […]