Window Managers

Blackbox

  • themes, styles and designs are all in the extra desktops
  • looks like a traditional computer screen screen saver
  • made for proficiently and quickness
  • works with almost any distro, expect 25% oof

IceWM

  • It’s like a Win95-OS/2-Motif-like window manager
  • command promptp are easy to use and efficient
  • works on GNOME and KDE

SteoOff

Resources:

http://www.linuxlinks.com/article/20081212191052868/blackbox.html

http://www.linuxlinks.com/article/20081210152135823/IceWM.html

http://www.desksoft.com/WindowManager.htm

TCP/IP and Networking

Networking Commands:

  • ifconfig configures and displays the IP parameters of a network interface
  • route used to set static routes and view the routing table
  • hostname necessary for viewing and setting the hostname of the system
  • nestat flexible command for viewing information about network statistics, current connections, listening ports
  • arp shows and manages the arp table
  • mii-tool used to set the interface parameters at data link layer
  • ip multi-purpose command for viewing and setting TCP/IP parameters and routes
  • tc traffic control command, used  for classifying, prioritizing, sharing, and limiting both inbound and outbound traffic
  • promisc  puts the interface in promiscuous mode
  • allmulti  the only people who receive packets sent to a multicast address are those programmed to listen to it

Resources:

http://www.firewall.cx/linux-knowledgebase-tutorials/linux-administration/851-linux-services-tcpip.html

http://www.oreilly.com/openbook/linag2/book/ch05.html

Scripting

Script Arguments:

  • ${0} — the name of a script being run
  • $?name — returns 1 if the variable name is defined, or 0 if it is not defined
  • $n — the value of the nth argument passed to the script
  • $argv[n] — the value of the nth argument passed to the script
  • $#argv[n] — the number of arguments passed to the script
  • $* — all the arguments supplied to the script
  • $$ — process identification number

Execution Policies:

  • Restricted — scripts won’t run
  • RemoteSigned — scripts created logically will run, but those downloaded from the internet will not (unless digitally signed by trusted publisher)
  • AllSigned — scripts will run only if they have been signed by a trusted publisher
  • Unrestricted — scripts will run regardless of where they have come from and whether they are signed

Nested Execution:

You can use several layers of statements, like an if statements within an if statement, or a while loop within a while loop. It just depends on how much you can manage.

User Prompts:

  • -a ANAME  the words are assigned to sequential indexes of the array variable ANAME, starting at 0; all elements are removed from ANAME before the assignments. Other NAME arguments are ignored
  • -d DELIM  the first character of DELIM is used to terminate the input line, rather than newline
  • -e  readline is used to obtain the line
  • -n NCHARS  read returns after reading NCHARS characters rather than waiting for a complete line of input
  • -p PROMPT  display PROMPT, without a trailing newline, before attempting to read any input. The prompt is displayed only if input is coming from a terminal
  • -r if this option is given, backslash does not act as an escape character. The backslash is considered to be part of the line. In particular, a backslash-newline pair may not be used as a line continuation
  • -s silent mode. If input is coming from a terminal, characters are not echoed
  • -t Cause read to time out and return failure if a complete line of input is not read within TIMEOUT seconds. This option has no effect if read is not reading input from the terminal or from a pipe
  • -u FD  Read input from file descriptor FD

Resources:

http://star-www.rl.ac.uk/docs/sc4.htx/node21.html

http://security.stackexchange.com/questions/1801/how-is-powershells-remotesigned-execution-policy-different-from-allsigned

http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_02.html

http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_08_02.html

Why You Should Consider LINUX!

What I’ve Learned:

All most people (the general public) know about Linux, is that geniuses and hackers use it to do magical things to make other things work. At least, That’s what I thought at the beginning of my journey though the outskirts of what my professor likes to call “LinuxLand”. I am in no way an expert, and I’m not getting rid of my Windows laptop any time soon, but I definitely have a new found respect for Linux and all its community has to offer.

I have personally discovered that Linux was a great gateway into learning to use the terminal (bash), and for network security people to practice their skills on. Linux also has great (and FREE) alternatives to most Windows/Mac applications, which would be fantastic for start up companies to use to keep costs down, or even for the average poor college student to thrive on in their learning environment.

Linux was created by Linus Torvald as a hobby, but now, anyone who is frustrated or confused by the Windows/Mac layout can use Linux and make the distro they choose completely suited to their needs.

Resource:

http://en.wikipedia.org/wiki/Linux

Inodes (Index Nodes)

This is a research paper I wrote about inodes for my Linux class at the University of Advancing Technology.

Whenever a new file is created, inodes, also called index nodes, are created with the file. Inodes for each file do not consist of the actual date inside the file, but instead, they contain the extra information about the file. This extra information is referred to as “metadata”, or “data about data”.

While files can be very large, the inode of even a large file can still be quite small. Inodes of files in a file system only take up, “roughly of 1% of the total disk space, whether it is a whole storage unit (hard disk, thumb drive, etc.) or a partition on a storage unit” (Buse). I think this is why the common computer user hasn’t heard of an inode before—it takes up so little space, that they don’t notice them. However, a user has seen parts of an inode of a file before, probably without realizing it. This is because inodes can consist of many different pieces of information about the file, as was said before.

Inodes can specifically contain changes made to the data in the file, and who changed that certain information, as well as when it occurred, and how much data the file now has. Inodes can potentially also contain data about the owner of the file, and permissions to other users granted by the owner, and status flags about the data in the file. The structure of an inode is actually a bit like building blocks, each containing some part of the metadata listed above. For each piece of information, there’s a default block size for it to be contained in, but this only occurs “[w]henever a partition is formatted with a file system” (Pillai).

Inodes, besides holding the metadata, are very useful too. Using the terminal, users are able to type in commands using inodes to find or even delete a file. Users can also change directories using it inode number.

There is limited space in the inode structure and “can be filled before the data portion of the storage unit” (Buse). However, this may only be the case of there are many smaller files within a structure until the inode storage is freed within it.

Users can also check inode utilization by typing specified commands into the terminal. Users are able to find out how many more inodes can be created within the storage unit, and what each inode for files consists of, depending on the type of file and how large the file is.

Works Cited

Buser, Jarret W. “Intro to Inodes.” Linux.org. N.p., 9 July 2013. Web. 23 Sept. 2014. <http://www.linux.org/threads/intro-to-inodes.4130/>.

Pillai, Sarath. “Inode and Its Structure in Linux.” [/ROOT.IN~]#:. Hello Bar, 1 Dec. 2012. Web. 23 Sept. 2014. <http%3A%2F%2Fwww.slashroot.in%2Finode-and-its-structure-linux>.

System Administration

This is a short paper I wrote on system administration for my Linux class at the University of Advancing Technology. 

There are many parts to system management and administration within a UNIX/LINUX environment. A few of them are assigning a system administrator to oversee the system, and setting up system/file permissions.

The role of a system administrator (sysadmin) is to maintain user accounts, installing/updating required software, create and update the system policies, and maintain the general documentation of the system. These are all very broad terms and jobs, but once the majority of things are set up, the sysadmin’s job is just to oversee everything and fix the bugs in their system.

Controlling a user’s account is very important within system administration because it’s crucial for user’s to stay within their bounds of permissions so that they don’t become an inconvenience to the other users. Creating new users within a database is done with the command “adduser.” Once their name has been added, the command line will also ask for the new user’s other information. This way is also brilliant because it will keep the administrator from adding duplicate accounts. Users can also switch between accounts easily as long as they know the password of the other account they are accessing. The “superuser” or “root” account (original owner) always needs to be protected by a password so as to not let those just using the system change things they shouldn’t be getting into i.e. file permissions, other users’ account information etc. A user’s account can be deleted by the command “userdel” (user delete), or just disabled by not being allowed to login. This is done with the command “etc/passwd,” and replacing their password with a “*.” This takes their password and turns it into an unknowable string of characters so that they aren’t able to log in to their account (Linux 6.1-6.5).

Within system permissions, there are several ways to administer to the needs of whoever needs to see or change the file. To change the ownership of the file, the “chown” (change owner) command is used. This command allows the user to both detach the original owner of the file, and give it a new owner. Another useful command is “chmod” which can grant access to a file of all members of a specified group. To change the default access group, the command “newgrp” is used in the terminal, followed by the group’s name.

These are just a few simple things to get started with system administration.

Works Cited:

Frampton, Steve. Linux Administration Made Easy. Linux Documentation Project, 1997. Web.06 Nov. 2014. <http://www.tldp.org/LDP/lame/LAME/linux-admin-made-easy/>.

Garrels, Machtelt. “Introduction to Basic Unix System Administration.” Introduction to BasicUnix System Administration. N.p., n.d. Web. 05 Nov. 2014. <http://tille.garrels.be/training/unix/>.

“User Administration.” ManageEngine® Applications Manager. Zoho Corporation Pvt. Ltd.,2014.Web. 05 Nov. 2014.<http://www.manageengine.com/products/applications_manager/help/administrative-operation/user-administration.html>.

Wirzenius, Lars, Joanna Oja, Stephen Stafford, and Alex Weeks. The Linux System Administrator’s Guide. Linux Documentation Project, 2004. Web. 06 Nov. 2014. <http://www.tldp.org/LDP/sag/html/sag.html>.

Intro to Linux

How LINUX Began

The father of the original Linux kernel was Linus Torvalds. He was a student at the University of Helsinki, and wanted an alternative operating system that was easier to use than MINIX as far as licensing. He created Linux to be open source and easy to use.

Parts that Make Up LINUX

  • Kernel — diagram here, it handles interfaces with devices and hardware
  • Shells — where the user interfaces with the operating systems kernel
  • File Systems — used to store data

LINUX is Great Because…

  • Customization of interface for any purpose
  • It’s all free! For almost all Windows/Mac applications, Linux has a free alternative
  • Open sourced — Bugs and problems are quickly fixed because of the huge community able to change the source code and solve the problem

Uses of Linux

  • Projects requiring high security — all users have access to every security patch (and few ever come up)
  • Low cost projects/companies — Linux applications are mostly free and have transferable file types to Windows an Mac
  • Play/Learn hacking and security — several distributions are centered on security, and are great for refining skills
  • Old laptop? Install Linux and you can get several more years of use out of it!

Resources:

http://en.wikipedia.org/wiki/Linux

http://lifehacker.com/top-10-uses-for-linux-even-if-your-main-pc-runs-window-1513172815

http://www.pcworld.com/article/201731/10_reasons_to_dump_windows_and_use_linux.html

Learning New Things

Class Activity Vocabulary/Lessons:

  • keep it in user mode
  • elevated mode for daemon (not in user mode–vulnerable)
  • elevated script
  • login script/service windows
  • trim–service running on ssd’s
  • daemons are services for windows

  • ampersand–fork to background–runs without using console, creates new instance to run in the background (once, but you can run more than one at a time)
  • “jobs” in terminal
  • need to tell fork to stop, otherwise it keeps going
  • dangers to running stuff in the background: keeps running, could have errors, needing input
  • “delete*.*” — not good
  • “nohup” — keeps things running after user logs out
  • “ps aux” 
    • a = show processes for all users
    • u = display the process’s user/owner
    • x = also show processes not attached to a terminal
  • “at” command — lets you execute a command or script at a later time (impromptu)
  • “cron” command —  a daemon that executes scheduled commands (use by creating a folder to put it in and it will continue to run forever)

  • “kill” — used with the PID address of a program to terminate its process
  • “killall” — used to terminate all processes running in the box!
 
Resourses:

Package Management and Compiling

Commands:

  • make — used to automatically determine which pieces of a large program need to be recompiled (a)

Package Managers:

1. RPM (Red Hat Package Manager)

  • created by Red Hat (b)
  • some features are: packages can be cryptographically verified with GPG and MD5, easier verification, and automatic build-time dependency evalution (c)
  • used for many Linux distros (b)

2. APT (Advance Package Tool)

  • simplifies software management (b)
  • also easy to update and upgrade (c)
  • cross-platform for Unix-like O.S.’s (c)
  • common commands: apt, apt-get, apt-cache (c)

3. Pacman

  • “uses pre-compiled binaries distributed in a compressed Tar archive” (b)
  • for facilitating regular package changes (f)
  • able to track dependencies (f)
  • “handles package installation, upgrades, removal and downgrades, and features automatic dependency resolution” (f)
  • used for Arch Linux, Frugalware, and DeLi Linux (b)

Resources:

a. http://linux.about.com/library/cmd/blcmdl1_make.htm

b. http://en.wikipedia.org/wiki/List_of_software_package_management_systems

c. http://en.wikipedia.org/wiki/RPM_Package_Manager

d. http://en.wikipedia.org/wiki/Advanced_Packaging_Tool

e. http://www.osnews.com/story/10047

f. http://en.wikipedia.org/wiki/Arch_Linux#Pacman

New Useful Definitions

More Definitions:

  • sed — short for “stream editor”, allows you to filter and transform text
  • awk — a utility/language designed for data extraction

Regex Metacharacters:

  • ^ — start of a string
  • $ — end of a string
  • . — any character
  • | — alteration
  • {…} — explicit quantifier notation
  • […] — explicit set of characters to match
  • (…) — logical grouping of part of an expression
  • — 0 or more of previous expression
  • + — 1 or more of previous expression
  • ? — 0 or 1 of previous expression; also forces minimal matching when an expression might match several strings within a search string
  • \ — preceding one of the above, it makes it a literal instead of a special character. Preceding a special matching character

Resource:

http://regexlib.com/CheatSheet.aspx?AspxAutoDetectCookieSupport=1