sbc_compliant: (Default)
Hopefully, the LJ account will be purged soon.
sbc_compliant: (Default)
Let's see how this goes.
sbc_compliant: (Default)
I was bummed that, after being flown to DFW for the gang interviews and schmoozing lab, I was declined the entry level position. That was interview 5, IIRC. I was bummed, because I *really* wanted the 14-week training in Israel.

However, they offered me a shot at the entry-level+1 SalesEng opening in central NJ, but, after interview 8, it was also given to someone with more security experience.

After that, I was really bummed, but I noticed that I was finally ready to move in order to work, again. Boy, the universe was just waiting for *that* dipswitch to be flipped. Life began to change pretty rapidly.

In the next 2 years, I ended up going back to school to be a substance abuse counselor, meeting my wife, changing majors to social work, and moving abroad. I will likely stay abroad until she retires in another 15-20 years, with the possible exception of going back to the States to get my clinical supervision.

Thanks for playing along.

I am undecided what to do with this journal, though. I may just get it printed out and delete it, afterward.
sbc_compliant: (Default)
resurrecting my old shell-scripting knowledge by re-reading this and my replacement tech library. (Mold occurred from improper storage of the old tech library.) I'm so grateful that I was given such a great grounding in RHEL back in 2005-2007.

I'm hoping that the SE position will fuel my old stagehand desire to be somewhere new every day *but* keep me in reasonable hours year-round.

OK, back to reviewing. I still have interviews to get through.
sbc_compliant: (Default)
and have recently started reading my primary LJ again. This one I try to reserve for my Unix learnings. Since I haven't played with *nix except to ssh into my ISP's mailserver, there has been no call to update this. I spend a lot of time on FB and G+.

After I got laid off from AOL (Fall 2007), I went back to stagehanding primarily. I did get a tech job with Cogent at one point, but found 2 things that just are no longer acceptable: a) sitting in a dark room and b) fielding calls from angry customers all day.

I miss projects and shell scripting.

Stagehand work is too seasonal, as well; so, for the last 2 years, I've been working at the local grocery store. Sigh. It's a job. I try to be grateful that I have it.

I wish I knew how to get into data center work. It seems like the right mix of using my hands and my head. Suggestions?

update

Apr. 1st, 2008 07:10 pm
sbc_compliant: (Default)
entry ++
sbc_compliant: (Default)
So, I had a customer today that had mistakenly added a bunch of hosts en masse to a config file via a GUI tool. The tool, however, does not allow for mass removal. So, the ticket came to me.

I removed the hosts from the config file using the magic of seq!

  • for i in `seq -w 036 1 200`; do command -rm "remove per [ticket_number]" host-complex$i.system.domain.tld; done


That -w flag is really handy for keeping the padding zeros in place, especially since the customer had started at such a non-round number.
sbc_compliant: (Default)
So, I had a list of items upon which I wanted to run a command.

The command required 2 arguments:
a) the list item and
b) the list item modified by a character substitution

I finally figured out how to mod the variable, and feed it in to my command, thusly:

for item in `cat list.txt`; do command `echo $item | sed 's/char1/char2/'` $item; done


Hooray sed!



p.s. Yes, I only needed the first instance of char1 on the line replaced. That's why I didn't use the trailing g in the sed replacement.
sbc_compliant: (Default)
One of my projects is to unSPOFify a system by creating a mirror. I've done a lot of the ancillary work (setting up FW holes and having DNS entries added), but now I'm getting down to the meat of the SA work -- building out the host.

Time to read up on logical volume management. I have logical volumes to create and extend, in order to match the initial host.
sbc_compliant: (Default)
So, today I had to look for $error_du_jour in a particular log file, in order to do some stuff the the items throwing the errors.

To find the items, I did this:

# grep 'ERROR_DU_JOUR' log > raw_results.txt
# head raw_results.txt 
[see raw results here, and find that the item in question is on field 20]
# awk '{print $20}' raw_results.txt > items.txt
# head items.txt
[see raw items here, with a trailing comma]
# sed 's/\,$//g' items.txt | sort -u > clean.txt
# cat clean.txt 
[see only list of affected items here]
# 


When I was done, and told my boss, he asked if I'd done it this way:

# grep 'ERROR_DU_JOUR' log | awk '{print $20}' | cut -d, -f1 | sort -u

So, then I went and scanned the man cut page. Pretty sweet little trick.
sbc_compliant: (Default)
today's two examples:

  • I wanted to find all the instances of "foo" that had "bar" in the path, plus find out whether they were files or directories
    ls -las `locate foo | grep bar`

  • Then I wanted to find all the instances of "blah" within the files that I found from the above example
    grep blah `locate foo | grep bar`


Awesome.
sbc_compliant: (Default)
Found out some more today, during the instructor's tangent, that xargs is even more nifty than I thought.

To wit, some programs just don't take input from STDIN. This is one of the reasons for which xargs was created.

  • example:


    find foo bar baz | xargs ls -lad
    This allows ls, which normally cannot be passed parameters, to only operate on the output of the find, instead of the local directory. Also, I found out that the -d flag for ls ensures that the directories are not expanded.

  • example:


    find foo -print0 | xargs -0 ls -lad
    This, like above, allows ls operate on the output of the find. Additionally, the -print0 argument on the find makes the find able to read filenames with whitespace. This is done by swapping in a zero for the \s. Along with this, the -0 flag on xargs allows it to read this modified output.
sbc_compliant: (Default)
yesterday in class we learned about conditional shell loops:

  • if then elif else fi

  • case esac


plus shell variables:


  • $1, $2, $3 ... $n
    command line arguments
  • $#
    count of all command line arguments
  • $*
    all command line arguments
  • $?
    exit code from last command


Today we're learning more about quoting, i/o, and loops.

It's fun to see what I do and don't know. Some of this is review; some is brand-spankin'-new.

Fr'ex, I found I can use $(cmd) in place of `cmd`.
sbc_compliant: (Default)
I was shown xargs the other day as a means of regularizing data for input.

I had a list of hosts in someList, with an unknown number of whitespace before and after each host, on which I wanted to perform someCommand -someFlag.

One of my co-workers told me to skip manually cleaning up the file and just pipe it through xargs.

Then, at my blank look, he explained xargs briefly and keyed the following into my terminal:

for hosts in `cat someList | xargs `; do someCommand -someFlag $hosts; done

Which processed the list. No muss, no fuss. Sweeeeeet.


Unfortunately, the output was rather lengthy. So, I ran it again, piping the output through a grep for the particular field that I needed.

for hosts in `cat someList | xargs `; do someCommand -someFlag $hosts; done | grep someParticularField

Presto.
sbc_compliant: (Default)
requests to "restart the server" may not always mean the host, they sometimes mean "the web server" (e.g. Apache).
sbc_compliant: (Default)
now all I need to do is source my bash aliases when I open a new term window on my mac, kinit $user, and I'm good all day at work.

when I get home, though, I need to kdestroy before I can ssh in to my ISP's mail server.
sbc_compliant: (Default)
When PHB was asking why I was still here, I said that I was trying to find a way to batch process until EOF.

He introduced me to the joys of while read foo; do and to call it by either cat file | script or script < file. He also showed me some variations on the logic: while read < file; do and while read < $1; do.

I've made two scripts, that I've needed to make for a while, in the last hour, and they both do what I want them to do. Yay!

Here's one:
Read more... )

Additionally, today I learned about file blah to find out what kind of file "blah" is.

Awesomesauce.
sbc_compliant: (Default)
I was shown recently more shortcuts by my boss:


  • chown v chown + chgrp


    $ chown user:GID file
    to change owner and group in one fell swoop


  • scp many


    $ scp user@host:file1 file2 file3 ... filen .
    to copy multiple dissimilar files from a remote host to my localhost all at once. I'd already known I could use the "*" wildcard to copy multiple similar files with one command
sbc_compliant: (Default)

# ps -ef | grep < partial_process_name >
# kill -HUP < pid or process name >


which tells the process to hangup and restart from its config file
sbc_compliant: (Default)
Did something neat today. I knew it was theoretically possible, but I just hadn't needed it until today, nor did I know the exact mechanics of implementing it.

I had keyed in less .bashrc to see some aliases, and realized I needed to add another one. I remembered that it's supposed to be possible to open vi from the less ouput. So, I said, "what the hey," and keyed in vi -- which dropped me into insert mode immediately.

I escaped from insert mode into command mode and then yanked a similar line to copy as a template. I pasted the line and then modified it to my liking. I was curious as to whether escaping the insert mode would drop me out of this instance of vi, since it was being invoked through another program.

After the :wq, I was dropped back into the less output, with my new addition visible.

Sweet.

Now I know how that works.
Page generated Feb. 10th, 2026 05:08 am
Powered by Dreamwidth Studios