Table of Contents
Andrew Sowers Fall 2011 Opus
Because You're awesome for reading this
Introduction
Holla, My name is obviously Andrew and this is my Opus, there are many like it but… this is mine! I am of nineteen earth cycles and my favorite thing to do tinker in the workshop of a basement that I so graciously call “The Lab” I am (currently at least) aspiring to develop and manage www.civicbeat.com - a beat/journalism start up based in and focusing on Chemung County and the municipality's there in. I've always known I was a bit of a geek, I was a member of the Big Flats Geek Squad for two years (no I did not drive the bug) and continue to actively dev in to other sorts of geekery. Through this course I hope to sharpen a set of skills that I've started to tinker with over the past 3 years.
Part 1
Entries
September/17/2011
- On this day I began the start of my PogoPlug ARM Server
- This project will give me a better understanding of the “Small is beautiful” philosophy through maximizing my available computing resourses.
- This project will act as a segway for future projects
- One of the more challenging aspects of this project was the lack of normal I/O devices. (There is no way to monitor the PogoPlug outside of an SSH session)
September 20 2011
Today I've opened up my router to accept remote ssh sessions to my PogoPlug server! This is monumental thing because now I have access to my own personal cloud I can tunnel into remotely via SFTP. I now don't have to depend on a third party for remote backup or online storage, it's accessible from anywhere and I know it's secure because I personally am administrating it.
- This is made possible through the use of port forwarding on my home router.
- SFTP allows me to access my server as if it were a directly connected database
- because I administrate this I am assured security.
- This also provides an external environment to field test the capabilities of UNIX as root (something not available through Lab46
September 22 2011
On this date I began dabbling in basic scripting. This script is simple It asks for a secret word! Scripting is important for several reasons:
- Sctipting gives power users and administrators the ability to preform complex system opperations through recording tasks in a “script”. A script is written in a text editor.
- Syntax is extremely important; even one extra or missing character could cripple your script
- If you understand scripting “sick and terrible things can be accomplished” - Haas (9/29/11)-reguarding ii
- I still need to dabble more in scripting so I can one day take over the world (that would be so wizard!)
September, 2011
This Month I've started playing around and researching Different Unix, Linux and GNU licensed softwares. In particular GNUstep has struck my fancy for several reasons.
- GNUstep is the last “mainstream” surviving *branded* remnant of NeXTSTEP, NeXTSTEP and later OPENSTEP became a fundamental foundation of Mac OS X so understanding the legacy of this modern operating system to me is fascinating.
- GNUstep is a wonderful programing environment because it is “all object oriented” this is nothing new but the legacy of yesteryear still fascinates me.
- understanding different NIX style systems is important to grasp the full dexterity Unix can offer
- GNUstep (though at it's core archaic) supports a wide variety of different platforms including the POWER architecture, something I'm very partial toward.
Topics
ls
a command for listing directories. The ls command has other attributes such as ls -a the “a” in this case will list hidden files or directories that begin with a period, for example “.file” would be hidden whereas ”file“ would not when listing a directory.
whoami
Even in the world of Nix one may ponder from time to time who they really are and find themselves asking whoami? The whoami command lists your sessions userid, this is helpful if you are working in a multi-user environment
grep
Freaking out because your string needs some tender love and input? Well, get a grep! Grep is a powerful tool that snips information in files and standard input to be placed somewhere els, this is especially useful when scripting because you can create strings that solve equations or finish tidious tasks.
who
Have you ever wanted to know who's doing what and where? Well you can! because the who command does just that! (imagine that) Here's how it works: when the user enters the who command their greeted with some lovely text that supplies WHO is logged in, WHO is running what processes and Who are you? Who, who, who, who?
screen
A virtual world means virtual desktops or in this case “screens”. When the user types the screen command they are greeted with a fresh new terminal, this gives the appearance of multiple sessions within a single terminal. The user can detach and reattach at their leisure. To detach hold '^a'release then promptly press the the 'd' key one time. If you would like to reattach simply type 'screen -r' in your terminal interface.
tee
While taking tee time you may want to catch up on some reading, perhaps some standard input or output? eh? right? ha. tee is a powerful utility that reads standard input and place it into standard output in association with pipes.
Root
The base of a tree is its root. The same can be said for a UNIX system, the root or superuser has an absolute permission over everything. This permission is temporarily granted to the superuser from the operating system and is promptly returned upon completion of the task.
sudo
To be sudo is like being a pseudo superuser. When a normal user temporarily requires superuser permissions the sudo command is typed in sequence with the action requiring root, sudo is placed at the beginning of the string. The user must mentioned in the sudoers file and supply the sudo password in order to obtain temporary superuser permissions.
Pipe
Piping is a powerful tool that allows the user to tie command together to complete more complex actions by tying standard out into standard input. There is no limit (within reason) to the number of pipe lines you can tie with a single command.
gcc
gcc is GNU C compiler. What that means is gcc will compile fresh written C code into an executable program.
Regular Expressions
Regular Expressions allow for the inclusion and separation of information within files to accomplish specific and complex tasks. Regular expressions can be tied together with pipes within strings to manipulate variables.
Man
Man… this has been a heck of a lot easier with this! ;)
Objectives
Objective 1
Become more acquainted with scripting
Method
My plan is to use some of the scripting examples laid out in class for tweaking so I further understand the syntax and structure of bash scripting
Measurement
This seems cut and dry to me. If what it do works, then happy day! if not I obviously have work to do. However the more the script is tweaked while remaining functional would be a good sign!
Analysis
Through reverse engineering some of the examples preformed in class I've been able manipulate the scripts to do different things such as:
- create a custom MOTD on my PogoLab server that displays running processes, users logged in and the current date.
Experiments
Experiment 1
Question
What is the question you'd like to pose for experimentation? State it here.
Resources
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Hypothesis
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
Experiment
How are you going to test your hypothesis? What is the structure of your experiment?
Data
Perform your experiment, and collect/document the results here.
Analysis
Based on the data collected:
- was your hypothesis correct?
- was your hypothesis not applicable?
- is there more going on than you originally thought? (shortcomings in hypothesis)
- what shortcomings might there be in your experiment?
- what shortcomings might there be in your data?
Conclusions
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.
Experiment 2
Question
What is the question you'd like to pose for experimentation? State it here.
Resources
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Hypothesis
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
Experiment
How are you going to test your hypothesis? What is the structure of your experiment?
Data
Perform your experiment, and collect/document the results here.
Analysis
Based on the data collected:
- was your hypothesis correct?
- was your hypothesis not applicable?
- is there more going on than you originally thought? (shortcomings in hypothesis)
- what shortcomings might there be in your experiment?
- what shortcomings might there be in your data?
Conclusions
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.
Experiment 3
Question
What is the question you'd like to pose for experimentation? State it here.
Resources
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Hypothesis
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
Experiment
How are you going to test your hypothesis? What is the structure of your experiment?
Data
Perform your experiment, and collect/document the results here.
Analysis
Based on the data collected:
- was your hypothesis correct?
- was your hypothesis not applicable?
- is there more going on than you originally thought? (shortcomings in hypothesis)
- what shortcomings might there be in your experiment?
- what shortcomings might there be in your data?
Conclusions
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.
Part 2
Entries
October 20, 2011
Today I brought my good friend Eli Cadwallader in to audit a class. Eli and I work on an upstart journalism initiative based in Chemung County, I am the developer and he is the journalist. The reason I believe this entry is important because it helps describe the applicable uses of UNIX to our enterprise. Our server is Unix based, both of our workstations are Unix based and the our target demographic of devices (mobile phones, tablets, iPhone, iPad, etc) are also Unix based. We really are moving into a Unix dominated world and it's important for everyone to understand the relevant technology behind the humanitarian efforts it can be used for.
October 24, 2011
Today I began a part time consulting job so John Cadwallader inc. (http://www.linkedin.com/pub/john-cadwallader/13/b64/500) John has several Windows machines and a single file server running Ubuntu 10.04. John hired me for these reasons:
- John's SAMBA share was broken… He needed someone to fix it.
- Johns network is currently a little slower then it could be… He has a VPN, a server, and 6 employee machines that his businesses depend on.
- John would like to know more about his infrastructure and decided to hire locally opposed to a support service
This is very relevant to this course because it involves administration of a network focusing on a UNIX based server at its core. I believe the purpose of this course is to make us more flexible computer/network/infrastructure administrators.
October 26, 2011
Today I've setup connections between my office for CivicBeat.com (111 N. Main st, Elmira NY), my home (236 Kendall Pl, Elmira NY), my Android phone and iPad. This allows me to do the following:
- maintain my own personal wide area network secured over ssh.
- have a constant connection to my *entire* digital life at all times.
- my entire network is now theoretically cloud based (all data is accessible via the net)
- this is a real-word opportunity to setup/administrate a wide area network
- now no matter where I am there will never be an excuse for not having enough drive space
- redundant backup can now my administrated remotely.
October 29, 2011
On this day I started working on my new Hackintosh machine for work…Why is this important? because utilitarians will succeed over all! understanding why mac OS software will run on an IBM clone is important if you truly want to understand the inner workings of the software technology that runs OS X.
unix Topics
fsck
Checks and repairs your file system.
echo
Echo is a powerful tool that allows the user to 'echo' an argument into standard output and you can even tie arguments to pipes to create complex strings.
Shell
A shell the users window to the operating system. It is the tool we use to manipulate files “everything is a file”. Here is a list of example shells:
- sh
- ksh
- csh
- tcsh
- bash
- zsh
In our lab46 instances we use the bash shell. A shell is not UNIX Dependant, for example; the bash shell can run on other *NIX* type operating systems such as Linux, Solaris, open VMS, Haiku and countless others.
Package managers
Package managers allow users to query a database of software for their operating system. Users can add different “repositories” to their package managers that allow software from other sources to be installed. Package managers will also update your software by checking the current version verses your own.
Arch
Arch displays the hosts systems architecture. Arch -k Displays the kernel architecture, such as sun4m, sun4c, and so forth. This defines which specific SunOS kernel will run on the machine, and has implications only for programs that depend on the kernel explicitly (for example, ps).
[root@alarm ~]# arch armv61 [root@alarm ~]#
Netstat
Netstat displays all network connections on the system.
htop
Top on steroids. Like top, htop displays processes but it allows the user to scroll vertically and horizontally. The user can also kill PIDs within the program!
rsync
rsync allows users to sync data over ssh sessions a lot like sftp. The user can copy and move files over the network in their shell!
[root@alarm ~]# rsync -rav asowers@lab46.corning-cc.edu: /home/asowers/ asowers@lab46.corning-cc.edu's password: receiving incremental file list created directory /home/asowers ./ .Xauthority .addressbook .bash_history .bash_logout .bashrc .indent.pro .lab.swp .lesshst .pine-passfile .pine-passfile.old .pinerc .pinerc.old .profile .swp .viminfo .xinitrc .xsession-errors Maildir -> /var/mail/asowers android-sdk_r13-linux_x86.tgz [root@alarm ~]#
iftop
Interface-top displays all of your network connections and the speed that they are running at.
[root@alarm ~]#iftop 12.5Kb 25.0Kb 37.5Kb 50.0Kb 62.5Kb └─────────────────────────────────────┴──────────────────────────────────────┴──────────────────────────────────────┴──────────────────────────────────────┴────────────────────────────────────── 192.168.1.144 => 192.168.1.137 1.08Kb 0.98Kb 1.21Kb <= 208b 208b 208b 192.168.1.255 => 192.168.1.143 0b 0b 0b <= 0b 437b 655b 192.168.1.255 => 192.168.1.137 0b 0b 0b <= 960b 354b 255b 192.168.1.144 => dns-cac-lb-01.rr.com 0b 0b 28b <= 0b 0b 50b 192.168.1.1 => all-systems.mcast.net 0b 0b 6b <= 0b 0b 0b ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── TX: cumm: 14.8KB peak: 2.20Kb rates: 1.08Kb 0.98Kb 1.24Kb RX: 12.4KB 3.76Kb 1.14Kb 999b 1.15Kb TOTAL: 27.2KB 4.77Kb 2.22Kb 1.95Kb 2.38Kb
Cowsay
Laughter is good for the soul
[root@alarm ~]# cowsay Hello Haas ____________ < Hello Haas > ------------ \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || [root@alarm ~]#
I had to search my package manager for “coysay” with the following command “pacman -Ss cowsay”. To get “coysay' I installed it with my package manager with the following command “pacman -S cowsay”
gzip
A file compression tool.
gunzip
un-zip gzip archives
unix Objective
Integrate Unix into my entire computing experience
Through dabbling with some of the topics we've talk about in class I've become inspired to integrate into ALL of my devices; Desktop, laptop, phone, tablet, office machine and my cloud server.
Method
Trial and error. I feel like Unix is a self exploration topic. I believe what we learn in class is designed to inspire expropriation on your own. I've figured out how to setup my very own wide area network that just a decade ago would seem alien…
Measurement
since September I've added my Cloud server. and setup network connection between my devices.
Analysis
Upon completing this task I believe it will have a positive effect on my work/school performance because I will constantly be able to have a secure connection to the root of my network.
Experiments
Fix failed update with moded kernel extensions?
Question
Is it possible to find and inject some moded kernel extensions after I updated and broke my kernel?(apple dropped atom support in version 10.6.2).
Resources
Boot verbose to find where the kernel hung up…it was an issue with initializing ACPI. I found a solution here: http://prasys.info/2011/06/howto-macos-x-10-6-8-and-intel-atoms/
Hypothesis
If I can find the necessary moded kernel extensions I will be able to patch my system by mounting the Hackintosh HDD via SATA to USB on my PowerBook and injecting the KEXTS manually into ”/system/library/extensions“.
Experiment
run the procedure stated in the hypothesis(Inject EvilAppleACPIPlatform.kext and EvilIOPCIFamily.kext into ”/system/library/extensions“), reassemble the system, boot and cross fingers.
Data
It works! boots into mac OS 10.6.8!
Conclusions
What's being done here is the kernel is first being tricked into thinking the current kernel is bad and the moded kernel is the default. The KEXTs are an additional essential piece of the moded kernel required to boot…Why can't software enlightenment come sooner so this is legal?
Experiment 2
Question
What is the question you'd like to pose for experimentation? State it here.
Resources
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Hypothesis
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
Experiment
How are you going to test your hypothesis? What is the structure of your experiment?
Data
Perform your experiment, and collect/document the results here.
Analysis
Based on the data collected:
- was your hypothesis correct?
- was your hypothesis not applicable?
- is there more going on than you originally thought? (shortcomings in hypothesis)
- what shortcomings might there be in your experiment?
- what shortcomings might there be in your data?
Conclusions
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.
Retest
If you're doing an experiment instead of a retest, delete this section.
If you've opted to test the experiment of someone else, delete the experiment section and steps above; perform the following steps:
State Experiment
Whose existing experiment are you going to retest? Prove the URL, note the author, and restate their question.
Resources
Evaluate their resources and commentary. Answer the following questions:
- Do you feel the given resources are adequate in providing sufficient background information?
- Are there additional resources you've found that you can add to the resources list?
- Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment?
- If you find a deviation in opinion, state why you think this might exist.
Hypothesis
State their experiment's hypothesis. Answer the following questions:
- Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover?
- What improvements could you make to their hypothesis, if any?
Experiment
Follow the steps given to recreate the original experiment. Answer the following questions:
- Are the instructions correct in successfully achieving the results?
- Is there room for improvement in the experiment instructions/description? What suggestions would you make?
- Would you make any alterations to the structure of the experiment to yield better results? What, and why?
Data
Publish the data you have gained from your performing of the experiment here.
Analysis
Answer the following:
- Does the data seem in-line with the published data from the original author?
- Can you explain any deviations?
- How about any sources of error?
- Is the stated hypothesis adequate?
Conclusions
Answer the following:
- What conclusions can you make based on performing the experiment?
- Do you feel the experiment was adequate in obtaining a further understanding of a concept?
- Does the original author appear to have gotten some value out of performing the experiment?
- Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author).
Part 3
Entries
November 15 2011
Today as a class we've started going over basic UNIX networking tools.
* These tools are invaluable to system administrators because they allow snapshots of the systems network interfaces. * UNIX is designed to be a network oriented operating system. * Networking tools can be incorporated into scripts so system administrators may automate their daily cleanup procedures. * Network interfaces break a holy rule of unix; network interfaces are NOT a file!
NoVember 23, 2011
Today I set up an administrative user account on PogoPlug server. It has come to my understanding that constantly using the root account is not ideal for day to day interaction with your system for a variety of reasons:
- It is not secure; what if your session as root is somehow intercepted? Your system would them be compromised.
- When a user uses 'su' or 'sudo' instead of the root account the commands are logged to syslog (3)
- a user cannot simply use sudo, they must be included in the sudoers file.
- the sudoers file is located here(on my system): /etc/sudoers
November 29, 2011
Today I setup 'htop' on my BlueHost domain server.
- I connect to this server via SSH
- htop is proving useful for monitoring the load limits my server can handle whilst I'm developing CivicBeat
- This plays more into the administration and maintenance portion of UNIX
- I can see that the themes in this course have dramatic real world application.
November 30, 2011
Last night I Noobishly executed a crippling loop script that broke my pipe and has incapacitated me…
- It would be wise to never execute scripts that you don't understand.
- I think it was a good lesson concerning what I had stated above.
- I sure am missing that “are you sure you want to do this?” prompt!
- What challenges are you facing with respect to the course? - I'm still locked out of lab46… so at this juncture; everything.
unix Topics
Kill
The kill command does just that… Kill PIDs of course. Simply run the ps command to see your listed processes, then type: “kill [the PID yo would like to kill]”
[root@alarm ~]# peace -bash: peace: command not found [root@alarm ~]# love -bash: love: command not found [root@alarm ~]# kill You must specify whom to kill [root@alarm ~]# ;)
dstat
dstat is a tool for monitoring system resource statistics
andrew@Dimension-4600:~$ dstat You did not select any stats, using -cdngy by default. ----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai hiq siq| read writ| recv send| in out | int csw 0 0 99 0 0 0|1734B 2747B| 0 0 | 136B 210B| 24 28 0 1 99 0 0 0| 0 0 | 594B 1766B| 0 0 | 53 61 0 0 100 0 0 0| 0 0 | 264B 1228B| 0 0 | 30 18 1 1 98 0 0 0| 0 0 | 741B 2739B| 0 0 | 55 71 9 0 91 0 0 0| 0 0 | 708B 1928B| 0 0 | 62 40 0 0 93 7 0 0| 0 16k| 701B 1478B| 0 0 | 64 81 1 1 98 0 0 0| 0 0 | 264B 1140B| 0 0 | 44 34 0 0 100 0 0 0| 0 0 | 198B 944B| 0 0 | 34 39 0 0 100 0 0 0| 0 0 | 264B 1140B| 0 0 | 35 30 0 0 100 0 0 0| 0 0 | 264B 944B| 0 0 | 35 40 1 1 98 0 0 0| 0 0 | 414B 1144B| 0 0 | 39 56 1 0 99 0 0 0| 0 4096B| 198B 944B| 0 0 | 41 47 0 0 100 0 0 0| 0 0 | 198B 1078B| 0 0 | 33 39 2 1 97 0 0 0| 0 0 | 893B 2309B| 0 0 | 68 72 8 1 91 0 0 0| 0 0 | 840B 2016B| 0 0 | 59 42 ^C andrew@Dimension-4600:~$
slurm
Slurm is another utility that displays network interface activity with an ascii text graph.
-= slurm 0.3.3 on Dimension-4600 =- x x x x x x x x x x x x x x x x x x x x x x x Current RX Speed: 0.00 KB/s Current TX Speed: 0.00 KB/s Graph Top RX Speed: Graph Top TX Speed:
mtr
mtr is the wonderful love-child of traceroute and ping. <3
[andrew@alarm ~]$ mtr civicbeat.com My traceroute [v0.81] alarm (0.0.0.0) Sun Nov 27 17:44:42 2011 Keys: Help Display mode Restart statistics Order of fields quit Packets Pings Host Loss% Snt Last Avg Best Wrst StDev 1. 192.168.1.1 0.0% 7 0.5 1.1 0.5 4.6 1.6 2. ??? 3. gi5-2-19-cmts.emirny27-rtr002.c 0.0% 7 9.5 10.3 9.2 13.5 1.5 4. ae15.ithcnycy-rtr001.cny.northe 0.0% 7 10.7 11.1 10.0 15.2 1.8 5. rdc-74-74-108-116.cny.northeast 0.0% 7 13.7 13.9 12.9 18.2 1.9 6. ae-3-0.cr0.chi10.tbone.rr.com 0.0% 7 26.7 27.9 26.3 30.4 1.6 7. ae-0-0.pr0.chi10.tbone.rr.com 0.0% 7 26.4 30.6 26.0 55.7 11.1 8. te0-2-0-7.ccr22.ord03.atlas.cog 0.0% 7 26.8 26.9 26.1 28.0 0.6 9. te0-0-0-1.ccr21.ord01.atlas.cog 0.0% 7 33.6 30.1 27.2 35.7 3.3 10. te0-4-0-3.ccr21.jfk02.atlas.cog 0.0% 7 42.1 42.1 41.1 42.9 0.5 11. te0-2-0-1.ccr22.jfk05.atlas.cog 0.0% 7 42.9 42.9 42.4 43.9 0.6 12. te4-2.mag01.jfk05.atlas.cogentc 0.0% 7 42.0 42.5 41.7 45.3 1.3 13. 38.104.74.118 0.0% 6 42.5 43.2 42.3 45.7 1.3 14. tg1-1.ar02.prov.acedc.net 0.0% 6 102.2 103.6 101.1 107.2 2.5 15. port99.ar02.prov.bluehost.com 0.0% 6 103.6 104.0 101.1 109.8 3.2 16. box259.bluehost.com 80.0% 6 105.7 105.7 105.7 105.7 0.0
powertop
This utility displays system power consumption for each individual component.
andrew@Dimension-4600:~$ sudo powertop PowerTOP 1.97 Overview Idle stats Frequency stats Device stats Tunables Summary: 0.0 wakeups/second, 0.0 GPU ops/second and 0.0 VFS ops/sec Usage Events/s Category Description 7.7 ms/s 0.0 Process powertop 7.4 ms/s 0.0 Process sshd: unknown [priv] 397.4 µs/s 0.0 Process sshd: unknown [net] 262.7 µs/s 0.0 Process /usr/lib/gnome-settings-daemon/gnome-settings-daemon 201.3 µs/s 0.0 Process rsyslogd -c5 157.0 µs/s 0.0 Process /usr/lib/gvfs/gvfs-gdu-volume-monitor 142.2 µs/s 0.0 Process avahi-daemon: running [Dimension-4600.local] 139.5 µs/s 0.0 Process nautilus -n 129.9 µs/s 0.0 Process /usr/lib/gvfs/gvfsd-trash --spawner :1.1 /org/gtk/gvfs/exec_spaw/0 127.5 µs/s 0.0 Process sshd: andrew@pts/1 106.8 µs/s 0.0 Process [migration/0] 101.0 µs/s 0.0 Process /usr/lib/i386-linux-gnu/colord/colord 79.4 µs/s 0.0 Process /usr/bin/python /usr/bin/update-manager --no-focus-on-map 77.3 µs/s 0.0 Interrupt [9] RCU(softirq) 71.9 µs/s 0.0 Timer hrtimer_wakeup 57.6 µs/s 0.0 Process update-notifier 49.6 µs/s 0.0 Process /usr/lib/indicator-datetime/indicator-datetime-service 41.5 µs/s 0.0 Process /usr/lib/accountsservice/accounts-daemon 40.1 µs/s 0.0 Timer tick_sched_timer 35.3 µs/s 0.0 Interrupt [3] net_rx(softirq) 31.6 µs/s 0.0 Process /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/gnome-session --session=ubuntu 25.4 µs/s 0.0 Process [flush-ecryptfs-] 21.6 µs/s 0.0 Interrupt [1] timer(softirq) 20.8 µs/s 0.0 Process [ksoftirqd/0] 14.7 µs/s 0.0 Interrupt [21] eth1 14.5 µs/s 0.0 Process [kworker/0:0] 10.5 µs/s 0.0 kWork flush_to_ldisc 8.0 µs/s 0.0 Timer clocksource_watchdog
calcurse
ever wonder why software distributors bundle heavyweight, cumbersome and convoluted Calendar programs? Why not go lean with 'calcurse'. Calcurse is a shell based calendar program with a nano'esque feel that keeps the unix philosophy in mind!
andrew@Dimension-4600:~$ calcurse ┌───────────────────────────────────────────────────────────┐┌──────────────────────────────┐ │ Appointments ││ Calendar │ │───────────────────────────────────────────────────────────││──────────────────────────────│ │ November 27, 2011 ││ November 2011 │ │ ││ Mon Tue Wed Thu Fri Sat Sun │ │ ││ 1 2 3 4 5 6 │ │ ││ 7 8 9 10 11 12 13 │ │ ││ 14 15 16 17 18 19 20 │ │ ││ 21 22 23 24 25 26 27 │ │ ││ 28 29 30 │ │ ││ │ │ │└──────────────────────────────┘ │ │┌──────────────────────────────┐ │ ││ ToDo │ │ ││──────────────────────────────│ │ ││1. Finish the Opus │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ └───────────────────────────────────────────────────────────┘└──────────────────────────────┘ ───[ Sun 2011-11-27 | 22:41:47 ]───(apts)──────────────────────────────────────────────────── i Import 0 beg Week ^A Add Appt ^L +1 Day ^J +1 Week ^R Redraw x Export $ end Week ^T Add Todo ^H -1 Day ^K -1 Week o OtherCmd
X11
X11 or “the X window system” makes it possible for UNIX and Linux: both text based operating systems, to run graphical applications. X11 is the graphical core for the NIX based GUI, it takes care of your mouse, keyboard, resolution and screen refresh rates. X11 is void of hardware dependancies and can load window sessions over network connections.
Window Managers
Your window manager is a graphical layer that sits atop of X11. Window managers help keep track of your windows, provide a way to graphically interact/launch applications, manage images and video. Technically the window manager is a program running on top of X11 and it's purpose is to extend the functionality of the X window system.
Desktop Environments
The final layer of our NIX based graphical user interface. The Desktop environment takes care of extended features above the window manager such as additional task and menu bars or an interactive desktop so the user can organize his work. An example of a rather popular desktop environment would be GNOME or “GNU Network Object Model Environment”
Executing processes in the background
Sometimes you need to run a process in the background and work on something else to do this execute your command with an '&' on the end. this will run the process and return the terminal prompt back to the user.
wget
wget is a “non-interactive” utility for downloading files via http, https or ftp protocols. Wget is non-interactive becasue it does not require the user to be logged on to continue downloading. Wget is also robust meaning the downladed files integrity are check for consistency, this is particularly helpful on poor performing network connections.
To use wget: ~$ wget “example address”
ls -u
List files in order of changes made
[root@alarm ~]# ls notes PKGBUILDs projects system vault [root@alarm ~]# ls -u projects system notes PKGBUILDs vault [root@alarm ~]#
unix Objective
Objective
Integrate what I've been learning in my UNIX class into my job @ civicbeat.com
use network monitoring and sftp tools in order utilize our domain server to its full potential.
Measurement
Use filezilla to download and upload files quickly and more efficiently then the GUI that bluehost provides. htop allows me to monitor network traffic and system resources in real time so I can test the integrity of my server.
Analysis
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
- Great! my Filezilla has brought up my workflow whilst I'm working at the office. instead of editing the files on the server directly I download the PHP or CSS file onto my machine for manipulation. This means I will always have a copy if I mess something up!
- I'm considering hosting my own server… perhaps some time in HPC next semester will help me make that decision?
- Could the course objective be altered to be more applicable? How would you alter it? yes, how to integrate UNIX networking tools into your work flow.
Experiments
"Cool Script" bro.
Question
Is it a good idea to execute crazy scripts you find on forums?
Resources
04-17-2009 quirkasaurus Registered User Join Date: Jan 2009 Location: canton, michigan Posts: 479 Thanks: 0 Thanked 7 Times in 7 Posts Quote: Originally Posted by Ikon This is an old one. At a job interview this was a script I had to explain. Code: :(){ :|:& };:
Hypothesis
Perhaps I should plug this in to Lab46 and see what it does? Will this script indeed be 'cool'? let us hope so!
Experiment
Script as follows:
#!/bin/bash :(){ :|:& };: exit 0
Then chmod 755 test (test was the name of the script) and execute ./test
Data
Uh-oh! we're caught in a pretty nasty loop… lets log out and re-establish our session, perhaps that might be a crude fix? - A wise man named Chuck Testa once said “Nope!” let's see why we can't re-establish our ssh session with an ssh -verbose or “ssh -v asowers@lab46.corning-cc.edu”
Last login: Wed Nov 30 20:33:03 on ttys001 Welcome Andrew! iMac:~ asow123$ ssh -v asowers@lab46.corning-cc.edu OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011 debug1: Reading configuration data /etc/ssh_config debug1: Applying options for * debug1: Connecting to lab46.corning-cc.edu [143.66.50.18] port 22. debug1: Connection established. debug1: identity file /Users/asow123/.ssh/id_rsa type -1 debug1: identity file /Users/asow123/.ssh/id_rsa-cert type -1 debug1: identity file /Users/asow123/.ssh/id_dsa type -1 debug1: identity file /Users/asow123/.ssh/id_dsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze1 debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.6 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 none debug1: kex: client->server aes128-ctr hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Host 'lab46.corning-cc.edu' is known and matches the RSA host key. debug1: Found key in /Users/asow123/.ssh/known_hosts:3 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Trying private key: /Users/asow123/.ssh/id_rsa debug1: Trying private key: /Users/asow123/.ssh/id_dsa debug1: Next authentication method: password asowers@lab46.corning-cc.edu's password: debug1: Authentication succeeded (password). Authenticated to lab46.corning-cc.edu ([143.66.50.18]:22). debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: channel 0: free: client-session, nchannels 1 Connection to lab46.corning-cc.edu closed by remote host. Connection to lab46.corning-cc.edu closed. Transferred: sent 1440, received 1752 bytes, in 0.0 seconds Bytes per second: sent 117482.9, received 142937.6 debug1: Exit status -1 iMac:~ asow123$
Welp kids, it looks as if we're locked out of the house… it turns out this script wasn't so cool after all.
Analysis
- script was in fact un-cool and essentially crippling.
- what shortcomings might there be in your experiment? - I cannot do anything… :(
Conclusions
Never, EVER execute scripts all nilly-willy… Especially if you find them on some forum.
Retest
If you're doing an experiment instead of a retest, delete this section.
If you've opted to test the experiment of someone else, delete the experiment section and steps above; perform the following steps:
State Experiment
Whose existing experiment are you going to retest? Prove the URL, note the author, and restate their question.
Resources
Evaluate their resources and commentary. Answer the following questions:
- Do you feel the given resources are adequate in providing sufficient background information?
- Are there additional resources you've found that you can add to the resources list?
- Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment?
- If you find a deviation in opinion, state why you think this might exist.
Hypothesis
State their experiment's hypothesis. Answer the following questions:
- Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover?
- What improvements could you make to their hypothesis, if any?
Experiment
Follow the steps given to recreate the original experiment. Answer the following questions:
- Are the instructions correct in successfully achieving the results?
- Is there room for improvement in the experiment instructions/description? What suggestions would you make?
- Would you make any alterations to the structure of the experiment to yield better results? What, and why?
Data
Publish the data you have gained from your performing of the experiment here.
Analysis
Answer the following:
- Does the data seem in-line with the published data from the original author?
- Can you explain any deviations?
- How about any sources of error?
- Is the stated hypothesis adequate?
Conclusions
Answer the following:
- What conclusions can you make based on performing the experiment?
- Do you feel the experiment was adequate in obtaining a further understanding of a concept?
- Does the original author appear to have gotten some value out of performing the experiment?
- Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author).