pictures

unix


Copy to Clipboard in the Command Line Interface (CLI)

hr
hr

Ever wonder how to copy something from the command line into the Mac OS clipboard? If you want to copy/paste a files content (perhaps a log file or a conf file, etc) into the clipboard to use outside of the CLI, you can use the commands pbcopy and pbpaste. Example: I want to copy the contents of my public key to the clipboard (so I can send it to a server admin who will use it in allowing me to access their subversion repository).

All I would need to do is:
cat id_dsa.pub | pbcopy

(cat writes out … [more]

Quick Site Backup (files and database) Via the Command Line

hr
hr

If you do any sort of web development, it is more than likely that CPANEL and phpMyAdmin are good friends of yours...and you depend on them. Even though those are extremely handy to create/modify databases and create backups, it is extremely helpful to know how to do the same thing by using only SSH and command line utilities.

To backup (export) a database using the command line interface (CLI):

CODE:
mysqldump -p --user=username --add-drop-table database> backup.sql

You will then need to provide your database password and the exported data will go into a file called "backup.sql" which is located ... [more]

mac OS X 10.5 (Leopard) smb fix.

hr
hr

I ran into an issue earlier today where I could not connect to a SMB share after my upgrade to Mac OS X 10.5. After some research, I found a thread in Apple's Discussions.

Basically...you need to not use "Connect to Server..." - you need to mount/unmount the SMB share via the command line.

Basic Mount/Unmount Process

  1. Create a directory (folder) where you want the mounted share to appear. I created a folder called "SMB" on my Desktop
  2. Type in the following command: mount_smbfs //useyourusername@localhost/remote_share /Users/useyourusername/Desktop/SMB in the terminal
  3. You will be prompted for your password, type it in
  4. You now have access ... [more]

Nano Tip.

hr
hr

I have been doing a lot of work recently on a remote server and have needed to use a text editor - so I decided to use the ever-so-easy nano. Problem is - the files I am working on are very long and editing them is not fun. I finally decided to look through the man pages (I am an emacs person myself) and found something that ended up saving me tons of time..."go to line number". If you are editing a file and know you need to edit something on line 1245, you would type in:
[code]nano ... [more]

whereis and locate.

hr
hr

A few simple commands to help make your life working with UNIX a little easier:

  • If you are looking for a certain programs, use:whereis. Example. You want to find out where ipfw is located. In the command line type whereis ipfw and whereis will spit out the location (/sbin/ipfw).
  • If you need to find a program or a file and you know what it is called, use:locate. Example. I know I want to uninstall MySQL, and I want to see every file that has mysql in the file path. In the command line, type locate MySQL ... [more]

print file size command.

hr
hr

Earlier today I was asked for the command to show a file size in UNIX and so I thought I would share. There are, of course, a few ways to do this. One great little command to keep handy is:du -h. The du (display utility) will print out the size of a file or directory. The -h will make it "human readable" (put the sizes in Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte). So, next time you need file or directory sizes, use du -h and be done with it!

command line to the rescue…again.

hr
hr

While upgrading a client's web site to XOOPS 2.0.14 I ran into some issues with the XOOPS 2.0.14 package file (a tar.gz file). Stuffit Expander would only extract a few folders, then report an error and quit. After a few attempts, and all failures, I had to chose to turn to the command line and bingo, no problems! So, if you ever have any issues with Stuffit Expander and need to uncompress a .tar.gz file, the following commands will come in handy:

  • To uncompress a gz file: gunzip file.gz
  • To uncompress a tar file:
    tar [tar options (usually xvf)] ... [more]

ubuntu 5.10 for PPC.

hr
hr

Well, after some problems downloading the 3.3GB image of Fedora Core 5 and then my PowerBook not recognizing the DVD media (no, I was not about to re-download all five install CD images and burn them to CD...this is not 1993 again with installer floppies everywhere...and I did not have any other DVD media on hand), I decided to try a different flavor of Linux: Ubuntu. A few people that I I have been talking to recently either prefer Ubuntu, or have recently tried it, like Tim. Since the install image is only 644.5MB, ... [more]

fedora core 5 for PPC users is available.

hr
hr

I have not had any recent how-tos or informational articles, but I am hoping to end that dry spell tomorrow after I install and configure Fedora 5. I have been very happy with Fedora 3 and 4, and look forward to the most recent release. Stay tuned.
PS...yeah I know that other builds, besides PPC are also out, but they are not my concern at this point.
[tags]Fedora Core 5[/tags]

print out certain line numbers with sed.

hr
hr

It has been a year now since I completed my UNIX/Linux certification training and every once and awhile I think about my friend Perl, but I really enjoy helping others with some simple needs. Ben (yeah, I got him using WordPress too ;)) aked me a great recently:

Question: If i have a huge log text fie and i want to pull a range of lines out of the middle, how can I easily do this?

Answer: sed -n '3,6 p' /var/log/httpd/error_log

Answer broken down:

  • sed is the UNIX tool I chose for this.
  • -n ... [more]

installing solaris 10, part 3.

hr
hr

Finally! (See part 1 and part 2) I have been wanting to check out Solaris for a few years, and now I have a fully functional system at home! Of course there were several roadblocks. CD errors. Drive space issues. Questions like: How do I boot from a CD? How do I format the hardrive? What does x error mean? Where do I go for support? all came up, but through extreme patience and an obsession for completing this project made this possible. Basically, if there could be an error or some sort of roadblock, I ... [more]

nagios updated.

hr
hr

Hi. I spent my exciting day with my old friend Nagios. Due to a few issues, I had to move my Nagios install to a new server, and while I had the time to move it, I also decided it was time to tweak it some. I wanted to point out that Nagios was updated to version 1.3 (change log). No major changes, but enough to upgrade.
Missed my Nagios articles?

Ps, the upgrade was a piece of cake. No issues (for once).
[tags]Nagios[/tags]

system monitoring with nagios - part 4 of 4.

hr
hr

nagios I have decided to write a four part article on the benefits of using Nagios. The first article focused on why I chose Nagios/what it offers. The second article focused on installing Nagios on Mac OS X. The third article focused on configuring Nagios. This fourth article will focus on improving the Nagios interface and further customizing it.

Customizing Nagios...the fun continues.
Run Nagios at Boot with an Init Script: There is a great article on how to create a StartUpItem for Mac OS X. Scroll all ... [more]

system monitoring with nagios - part 3 of 4.

hr
hr

nagios I have decided to write a four part article on the benefits of using Nagios. The first article focused on why I chose Nagios/what it offers. The second article focused on installing Nagios on Mac OS X. This third article will focuses on configuring Nagios. The fourth article will focus on improving the Nagios interface and further customizing it.

Configuring Nagios...let the fun begin! With version 1.2 of Nagios, there are multiple files by default located in /usr/local/nagios/etc/:

  • cgi.cfg This file is used to define the settings ... [more]

system monitoring with nagios - part 2 of 4.

hr
hr

nagios I have decided to write a three part article on the benefits of using Nagios. The first article focused on why I chose Nagios/what it offers. This second article will focus on installing Nagios on Mac OS X. The third article will focus on configuring Nagios. The fourth article will focus on improving the Nagios interface and further customizing it.

Downloading Nagios 1.2 (and other files)
At the time of this article, the stable release of Nagios is 1.2. There is a beta out for version 2 (2.0b4), ... [more]

system monitoring with nagios - part 1 of 4.

hr
hr

nagios I have decided to write a three part article on the benefits of using Nagios. This first article will focus on why I chose Nagios/what it offers. The second article will focus on installing Nagios on Mac OS X. The third article will focus on configuring Nagios. The fourth article will focus on improving the Nagios interface and further customizing it.

If you manage a network with multiple servers or perhaps even just one server that runs multiple services (HTTP, SMTP, SMB, AFP, FTP, etc) and are looking for ... [more]

podcasts, nano, emacs, vps, and magnetic poetry.

hr
hr
  • podcasts: I am a workaholic. I stop to take the dog out, eat, and watch Guiding Light. My grandmother listened to it on the radio. My mother watched it on the TV, and now, I can make the next jump in technology...CBS is now offering each episode as a podcast.
  • iPod nano: Good work Apple. This new iPod is a great display of your amazing design.
  • emacs: Today I officially made the move to emacs for my new text editor of choice. I have been trying to make the move since last spring...and ... [more]

how to easily disable SSH for an individual user.

hr
hr

If you ever use Mac OS X client as a file server, or any type of server where you want some users to have access to SSH and others not, you can easily make it happen by using our old friend NetInfo Manager Applications > Utilities > NetInfo Manager. You can, very quickly, make sure that pesky user does not have shell access by defining the shell for the user as /bin/false. Sure there are other command line ways to do it, but come on, any chance to work with NetInfo Manager...you are going to take it!... [more]

installing Solaris 10, part 2.

hr
hr

Well. Now that I have Soalris 10 installed (failure on disk 2 and disk 3), I have been trying to learn the ins and outs of the system. I have been struggling with trying to get Java Desktop System 3 to start up. I can work in Common Desktop Environment without any technical problems, but who wants to work in that? Since I had some failures with disks 2 and 3 with several attempts, I am going to try and do the install using NFS via my Mac Mini to try and eliminate any ... [more]

installing Solaris 10, part 1.

hr
hr

I had decided last month to get a Sun machine so I could check out Solaris 10 (and Solaris in general). Why Solaris? Why not! Sun has been a leader in creating rock solid, high performance hardware and software, and now they have released Solaris for free. Time to check it out. I downloaded the four CD images from Sun's web site (nice job with the redesign Sun!) and thought the process would be realitively fast and painless. Then reality sunk in. New hardware (Sun Ultra 10) and a new ... [more]


search

subscription information

Blog RSS

Comments RSS



Powered by FeedBlitz

blog categories

blog tags

most popular posts

  1. using parallels and windows for web development debugging.
  2. remove all .svn directories in a directory.
  3. wordpress newsletter plugin.
  4. jappler recommends: room & board (store).
  5. php live training.
  6. another good first tuesday in november.
  7. so long, farewell ben!
  8. css containers: one image, fixed width, rounded corners.
  9. feel better soon joe paterno.
  10. outlook users having issues with mail.app attachments.

blog archive

standards

Get Firefox!
XHTML
CSS