Ugh

Loneliness is the worst pain in this world. It constantly eats away the person’s heart, and can cause the person to hate, to feel enraged–the same rage and hate that can cause one person to kill another. It is like a wound of the heart; the type of wounds that cannot go away with a kiss or a hug. The only thing that can make this great pain go away is love and compassion, another human heart to pull them out of this hell. β€”Diana

Too true…

Any way, spent a bit of the day thinking about a Shell written in ruby that gives access to ruby and possibly shell commands at the same time – right on the command line. Also about a plugin for vim that might let me post to my LJ from Vim xD

Being a man of many shells among other things I’ve been toying with the Z-Shell. It’s about has heavy as KDE or GNOME as far as shells meets Desktops but still good. The man pages are a bit of flood but thenew user config thingy is nice. I’ve set up a nice little .zshrc file. I’ve ported my aliases over and it has most of my enviroment specs all ready. Usually you get a default prompt of ether $ or % but zsh’s was hostname$, which is what I use for root so hehe never mind. I’ve got the prompt setup to be like Username@hostname$ only the hostname is really in bold and the $ is green πŸ˜€

Also I’ve got a time display at the end of line or “Right Prompt”, if I type till I hit it the clock hides it self. So far nice shell even if it seems to have a built in FTP client. ZSH is very configurable and it looks like it even has typo correction ability. You really just got to look through the config program and a few FAQs.

I’ve switched my laptop from KDE/BB back to KDE/KWin, replacing the blackbox toolbar on the bottom with a transparent auto-hiding external taskbar up top. Now if I just had a clock easier to read then GKrellM2 without running a shell or any thing >_< Most of the rest of my day, what else can I say? Life sucks some times. It feels like I get blamed for every thing.. Maybe I should get more into computers or more into "regular" things I just don't know any more. Online, I have a life worth living. I'm a corpral in the [SAS], I can teach people my trade and help others to grow. Who knows in time maybe Miles will follow it into NCO'hood. I hang around PC-BSDs community support forum and drop by ZoomCities forum from time to time (an IT nettunity for say). At least I've learned enough about this system I can be a little bit useful. One of the reasons I love computers, is that they are like me. A computer will do what you tell it, not what you wanted it to do. Obiously if I say iterate over this 10 times and do this the machine will. If I'm told to get a book off the top shelf by george I'm looking for one on the top shelf and wondering what book they wanted me to get >_< HEhehehe I can't help but chuckle alittle. Here, I'm free. Yet here I'm $#!+. At least online, well I wouldn't say I'm usually respected but I'm not disrespected. They don't threat me like a retard on the net. If any one whose ever followed my forum activity (which is freaking embarrasing really). You can see I've got about 7,500+ posts between 3 forums over the course of > 2 years to < 1 year depending on which one. I've rarly failed to put forth my opinoin of comments.. yet in the real world I'm rarly talk. Who do I have to talk too that really gives a crap ? Ya know a plugin for *Mozilla and Konqi to use nvi editing on text posts would be nice. I love computers and I love CQ Tactics and the team work that goes with them. I think if I put the haul into the PT I might even be able to make it as a Cop with some luck. My time with the [SAS] has broken me for the typcial erratic gaming group, I need teamwork. I usually prefer tactical play with a realistic PoV. We play in a very simular mater to real world units and I enjoy that. Needless to say few people even gamings are close to what the [SAS] has and less care about "tactics". Yes I do prefer a good game of chess when I can get one :-P Sigh.. I'm also the only one here with, well any compentcy (if you call it that) with a Unix like system. Most people I know, I don't mean to be mean to friends or any thing but PEBKAC issues are more likly then Windows crapouts some times I think when some one can be counted as Joe User. Love life? Why bother. I've got about $10 to my name till December and it's likly every thing I get then will half to go for bills. A new company took over so the rent is due the 1st or you get $80/day late feels and a 8+ year resident family gets paid on the 3rd of the month. This means when the lease is up it's time to move or be one month ahead, so yeah... Ballocks as always. I don't mind the $, but it's not fair to the tennents. What does love mean to me? Every thing that matters. I have nothing but the shirt on my back and the computer'dexed info in my brains measly 340Kb. I just feel like screaming Serria Hotel India Tango repeatidly and loudly. I don't really curse alot (off work...) I did for a while and when I was little. When I was about 5 I desided not to curse any more. Well my family is known to use profanity often ^_^ Around the times one of my friends died, I started out cursing a wing mate online (a US Marine to boot). Eventually it was [SAS]_Sgt_James who rung me in as I was a [SAS] Recruit at the time. So now I generally keep things PG13'ish and PG on the servers. I know it wouldn't do any good but it would feel good. What was tha told tag line? "I'm mad as hell, and I'm not going to take it any more!" Well I agree with that, only theres not much I can do. Usually I'm the "Chopping block" for stress releif more often then I can releve my own. Fuuy, I'm not sure whats worse. Thinking about my life as I right in a journal or not being able to sleep because my brain won't take a nap. Usually when I t hink about things I want to post, or do I have no time to do them and little to no computer access. So when things do catch up it's a long blog post. I really would like to get more into Ruby programming, it's a good language and I know I could go farther in it. I've been learning more about sed and I've been righting a little "YANSHELLFAQ" or Yet Another Shell FAQ, well it's really a tutorial/guide book really. I'm trying to get it sorted and it's basically ment for newbies. I intend to append a link to the post here (where else would I put it then my blog) in my PC-BSD forum sig. That way maybe this blog could help some one, especially if they are like I was not to long ago. Yarning to learn but with little aid to do it. I don't think nothing would please me more then to have the love of my life with me. Some one to share my soul with and vice versa.. but I know its not going to happen any time soon. Lovers are easier then loves. My mind seems to bleep between subjects doesn't it ? Oh well, can't really help the way my mind works. Usually my thinking is half structured. I'm very good at holding a thought and working it over piece by piece, if it interests me intently. The problem is by the time I can implement it I've moved on to other things. Just like this sentance >_< sigh… What to do, oh what to do this far 0620Z in the morning. I just don’t know any more but at least it feels better to flow through keyboad then roll with thoughts. I suppose a live journal is a poor outlet for things that should be shared with a live person… but well how many live people would I can talk to would I like to share every thing with ? Not many, even family (I’m generally family oriented).

One thing I do hate about putting together 20-Year plans is that if your approching your 20s in a few years you gotta remember what good starting 5 years ago would have done. I hope maybe, when I’m around 21~22 I can see if I can get a company to pay for my certifications and give me a job. Heck, if they’d pay me a good $2500 a month and give me good terms for network usage of my _personal_ computer they’d get a hard worker.

What I mean by that ^^ is I can run what I want on my own computer (personal laptop) without any ballocking. As long as it’s on my own time. I’m usually on a few forums, several web sites, a terminal, a console and a few IMs / IRC channels just at home. Thats not appriate for work but I’m not going to be forced not to run what to get my job done. If I want to use Seamonkey for my browser/mail I’m sure doing it ! I’ll PGP the mbox before going home if they want and only use it for business but I’m using my choice of client when it’s the computer I paid for!

Other then that, hell as long as I can make enough to live I don’t care what they pay me if I’m around computers. I get the concept of $2500 from basic bills where I live. S’bout a good $650~800 rent any where I know of for an apartment. Figure money for utilities and supples (like FOOD!!!). + Transport e.t.c. It adds up. If I don’t have to spend my time worrying how to make ends meat, I can keep my brain on the computers. >_< I remember we once figured out it would take a couple about $1600 a month just to handle a roof over head, food on the table, and utilties. Cars and Kids not included so lol it’s not a bright picture. I know one of my friends in the [SAS], he’s got to be like 30 and still lives at home for one simple reason. It costs to darn much to move out ! A man and a woman together can be hard pressed let along a single person. If I ever get god work I’d hope to get an apartment. To be honest, I’m more likly to not be able to well, can’t talk about probably. Then to end up married any time soon. Some things in life are just painful, love and hate are but a hairline. Passion and pleasure how far apart ? What once was thus no longer. RIddles eh? I’m not proud of this world but it’s all I have to keep sane. If the “Private” post option wasn’t stll viewable by the administration I’d probably post more about a few things just to get it off me chest. It’s funny though, how two people could go so far yet sink so low. To the point of knowing anothers mind, yet through a course of life that is hard to explain. **** I quit. Mmm odd my HDD light is on and gkrellm showed a nice low bust of I/O on ad0. Maybe it’s a cron job set to run around 0640Z. It’s just I want more to life and less of certain matters. Whats my 20 year out look shaping out like? Well… Get at least a good level of scripting ability and manage time to learn programming properly by retirement. Would be nice to be meet a sweet woman. Job that lets me work with, on, and around computers for most if it. Learn every thing I can about using, running, and adminsitrating a FreeBSD system. Advance in my networking knowedlge and computer ability. Maybe learn how to spell this time of morning Hopefully have an apartment of my own A few bits of change Try to wok out some method where I can put 10% away as sort of a “Carry over” fund to save for the future and bad days. 10% to let me be giving when I see a chance to help out. And keep bills paid. I’d love very much to be a father and a husband some day Eventually, get to be Free offline in public as I am online or when with friends or alone. I’d love it if I could implement all this, a few parts are just in GOD and fates hands but the rest I know I can try to do. What sucks about planning to meet my goals is knowing I’d be there on ideal time if I started earlier. I really started getting into computers maybe 3 years ago, now in less then a year of *BSD look at how far I’ve come? I’m sure a shell no exbert but I’m learning, I’mloving, I’m having joy. Even the idea of spending all day to install NetBSD, set it up (not an easy task), and get it cooking for duty would be my cup of tea. I love this stuff. I know if I had the ability and freedom to do a few things I could work on the other issues. Having a few bucks around and transport helps. Mmm what to do with another matter… I just don’t know any more. I’ve got to do some ting, maybe I’ll go to bed..

Vi, Macs, and Shells

I’ve so got to get or make a Vim plug in or some thing for this.

So far I’ve come to a cross roads, I can keep my editor or I can become more Emacs compatible. On Windows I use PuTTY for a ssh client. I don’t know what the terminal emulator is but it sucks. When working on Vectra I effectively have no insert/home keys e.t.c. or Numpad which is bad because I’m accustomed to using the home and end keys in my line editing. This means ether live with only cursor keys and backspace for line editing or relearn the Emacs navigation commands. Control+key is used, b for back one char, f for forward one char. p for previous command (up) and N for Next command (down). e for end of line while a is used for end and home key replacements. Using the meta key (generally alt) turns this up a notch and uses larger units such as forward a word instead of a char. I’m used to using control+u and control+w in line editing – I don’t know if control+w has effect in Emacs but control+u doesn’t.

Needless to say I don’t like Emacs ! I used XEmacs as my editor at first but I fell in love with Vim after I started getting into shell use. You could say learning the shell helped me learn Vim and vice versa. I didn’t like vim at first and I’m only now starting to use gvim off windows (konsole is better then cmd.exe). I’m very used to Vim so I am also used to Vi. My vimrc file makes it easier to use but since Vectra is very light on the software I didn’t install vim. Vi is good enough and ee for when I’m just pissed.

Vim/Vi is very simple to use once you get the hang of it, Emacs is just wrist strain. So now I ask my self the question: What about Vi editing mode? The Bourne and Korn shells support it as does the Z shell AFAIK. However I use tcsh which does not. So if I want to use this editing mode that means use another shell. Vectra only has sh and tcsh. Being FreeBSD the csh is actually tcsh but not like how bash is commonly GNU/Linuxes sh. FreeBSD uses ash as s, a very light Bourne shell clone. I could install any other shell I want really and a ruby shell would be kind of cool if it could fuse an interactive shell, scripting and ruby into one package. The problem is if I get used to vi line editing in a shell I’ll be ruined for any other shell !. I’ve yet to decide but to be honest with the Vi editing mode I think sh is livable. It nets the use of cursor keys and command history.

nvi/Vim is very simple. Vi is a modal editor, if you press escape you are in a command mode, if you press “i” or insert you are in insert mode and it’s like most text editors. You litterly change the entire keyboard into/out of modes. In insert mode your keys always insert chars, most consoles let you use the arrow keys, home/end/delete/backspace like normal. In normal mode which can be reached by pressing escape. Every key stroke is a command or switches to other modes. You can move the cursor with the h,j,k,and l keys. The h and l keys move left and right while the j and k keys move down and up. I’ve heard that Bill Joys console had arrow keys on these so that’s probably why they are used this way. It was a little weird at first but now I’m getting used to it. I’ve generally used the cursors.You can delete a char using the “x” key.

You can delete directionally by prefixing a movement key with d. So dh and dl deletes one char to the left or right. Pressing dj or dk will delete the current line and the line below or above. To kill the whole line use dd. You can repeat commands by appending a number, example: dd3 will delete 3 lines. You can move to the start or end of line by pressing ^ and $ this also works with d. You might notice ^ and $ from some studies in regular expressions – I do from a bit of sed/grep/awk learning. You can move forward and back a word at a time with the w and b keys. Much faster then control+key combo and easier on the wrists IMHO! Pressing i puts you into insert mode to enter text, pressing v puts you in visual mode. Escape will bring you back to normal mode. I never used visual mode very much at first but now I find it useful. In visual mode most normal mode commands for movement work the same. Yet when you move the cursor you always highlight or “select” text. You can copy it or “yank” it with the y command and put or “paste” it with the p command. If you want to cut it use the c command. Usually after a cut I think Vim puts you in insert. Pressing : gives you a little command line.

Here you can enter commands but internal and external, set options and more. To edit a file type e /file/name after pressing : for speed I bound ; to do the same as : in my vimrc. To save it’s :w also know as write ! To quit it’s :q note that you press the ” : ” you don’t type it as part of the command. You can override it by suffixing it with a !. Example: force a quit by doing a :q!

We can run shell commands by prefixing them with a “!” like this :!ls ~/Documents. File name completion works and a UNIX shell is better at it then cmd.exe (vim is very portable). Vim might seem a bit awkward at first but once your used to it it’s very fast and effeienct. TO get help type :help to get context sensitive help try :help topic_or_cmd

Using vi line editing in a shell works the same was using Vi only you start off in insert mode instead of normal mode. I haven’t decided what to do yet.

Ya know whats funny…. I started out to write a short post about my feelings but I end up trying to knock out a Vi/Vim intro before my batteries run out.

All roads lead to Vi !!!

The day rolls on

Well I’ve finally gotton ntpd working the way I want it, I think. My laptop is showing Vectra as a peer in ntpq. As to SAL1600, windows can’t nativly talk to ntpd on unix without a kick in the registry AFAIK. So instead of hacking apart my registry I’ve installed nettime after reading an article. It’s an abandonded project but I’m lazy.

I installed nettime and set it up to start the service at boot and use my time serving machine Vectra. Since I run a firewall on Windows that is set to block any thing not matching a rule, I made one.

WARNING: low qaulity 1600×1200 Jpeg

I need to setup ntpd on Ubuntu and run a tcpdump in less I can find an equivulent for Windows XP. This fire wall rule will do for right now and I can edit it later if I find I need to.

Waiting on a full scale distclean of my ports collection on Vectra and a du after that. On the 15th Vectra dropped off the lan , was totally dead to the world in regards to the network. After work when I got back to the computer I unplugged the router for a short count of twenty sec then replugged it in. Five minutes later when I got back to my desk I powered Vectra up and she recived her DCHPOFFER from the router. Interestingly, a post I made about it on a forum I vist ocasionally the first reccomendation was what I was affriad it would be the ol’yank, wait, plug the router bit. Awhile after posting that it solved the issue the forum owner posted this:

“I should’ve elaborated my first answer when I said “reboot the router” unplugging it is the best way because it clears the excess voltage in its capacitors which causes invalid data in its memory therefore the router will not function properly! Good on you TerryP!”

I find this an interesting idea, I can see how excess voltage in the capacitors could be aproblem for it’s memory (all 8MB of RAM and 2MB of flash memory of it). What I don’t get is why it should be neccesary to flip a device on/off, why not design it to deal with it or some thing? Eh maybe I just don’t know crap or it was made by a Windows fan.

I’ve been fooling with ntpd allot, if I’d stop editing the file maybe I could be sure of my configurations hehe. I keep the below blog entry fairly up to date.

Installed the PC-BSD 1.3BETA1 on my desktop heres a copy of the notes I wrote myself before posting on PC-BSD.

Notes:

First installer screen needs to say KDE is a DE not a WM, it will confuse people.

Installer didn’t allow an option toggle autologin.

Glad to see installer says PC-BSD not FreeBSD in the ASCII art and boot menu which is also used now at boot up. < I never did a 1.2 install so I wouldn't know if this is new or not. Installer detected my SATAII (ad0) drive and some free USB ports (da0-3). Drive layout was 180GB NTFS (WinXP), 79GB Ext3 (Ubuntu), 120+GB Freespace, Extended partition /w 4 logical drives (linux swap, home, and backups) Partitions detected right, NTFS, EXT3, DOS Extended. -> Didn’t detected my freespace ! Rebooted and manually fdisked me a UFS2 slice to use.

Installer doesn’t make it clear in the adv. Setup if PF will (if it needs to) be configured accordingly if you choose to use NTPD.

Installer could use tooltips.

Using the quick guide pressing “Index” in pages sends you to /PCBSD/docs/guide/ on the FS not /PCBSD/docs/guide/index.html (Time for a sed script)

Icon setup is great opens the right profiles to, only the “Start” Menu should be named some thing less Windows like and more consistant with the documentation that refers to it as a “K-Menu” -> We don’t need confused people saying “Whats a K-Menu” and it’s probably patented by Microsoft or Apple.

The pictures in the quick guide do not match the window decore, K-Menu, or Panel of the actual system

~/looks good, although some sample images and/or a PC-BSD_theme_song.ogg would be nice as would be a Video interview with the dev’s talking about the system. All in the right dirs of course.

There should be a fairly consistant (simular) rc file for each shell. (sh, csh/tcsh, bash). It should at least set the same basic env vars and the prompt.

/etc has a few .bak files and shells only shows bash by it’s symlink in /bin not both /bin and /usr/local/bin.

The “Start” menu looks nice but is a bit scrungy looking, the PC-BSD side img that used to be used /was/ nice tho

nice to see GTK 1.2 and 2.8 installed along with gtkglarea and python bindings. gtk-qt-engine+ Control Center entry -> Nice !

Noticed the new style lipstik used, PCBSD style should be renamed PCBSD Classic or v1.2 or something. I like what you’ve done with the Crystal windecore, think I might clone it to my lappy next time I change my windecore.

I wish KDE would fix the Component Chooser. (installed version is 3.5.4)

ruby, portaudit, portupgrade are installed among the 255 pkg’s (including a pair for the KDE style/windecore).

I see ispell is setup in KDE but pkg_info | grep spell only returns aspell dunno if thats right or not.

I get a default resolution of 1280×1024 just like in Ubuntu, I call it the “livable” res since I prefer 1600×1200 or larger + large fonts xD

Would be nice if NUMLOCK was turned on automaticly when booting a Desktop. It’s kinda expected.

Printers section gives an error

root has a pair of msg from june and the MOTD is still FreeBSD

PCBSDv1.3 conf still references itself ontop as the GENERIC FreeBSD conf. It’s set for machine i386 and cpu’s 486-686.

There is no sound drivers being loaded in my loader.conf. Usually FreeBSDs OSS doesn’t notice my audigy4 and I have to install the emu10kx driver. On Ubuntu ALSA can use it with the included standard driver (emu10k1 I think, or maybe emu10k3).

paths should be set to automatically have the users “Documents path” set to /usr/home/${USER}/Documents since you give them a dir for it.

There are no help items for the PC-BSD related Control Center entries. This is more a standard policy imho for PC-BSD. Want help? Get GNOME, want functionality? Get KDE !

I think the menu editor might be fixed finally !!!

Launching KDE reports it can’t find the codecs or libdvdcss since they are in the Essential Codecs PBI.

It also reports “DVD Drive” Can’t check DMA mode. Permission denied or no such device: “/dev/dvd”

I hope 0.8.2 fixes the stability problems in 0.8.1 (PC-BSD v1.2)

The X config file is XF86Config but we still use Xorg 6.9

Some interesting changes in /PCBSD/cardDetect which appear to come from RoFreeSBIE

__________________END___________________

Really I think they are making an improvement, I just don’t care for what they have done with the K-Menu. Also for some odd reason Keramilk, crystal, and polyester window decore keeps coming back to me.

NTPd

Well, today I noticed my windows machine was running 39 minutes past the hour, my freebsd machine 37 minutes past the hour (SAL and Vectra respectivly). I sync’d SALs clock with the defualt server and found my bsd box behind. Origenally I set the CMOS clock on Vectra to GMT time using my wristwatch, so a few min off after a month isn’t bad.

I’ve desided to run ntpd (network time protocal daemon) on Vectra and use her to sync my other machines with. After a little researching I found out my ISP has a ntp server so I’m using that. The NTP daemon should come preinstalled on a FreeBSD box, it’s also in ports if you need to update it without the whole computer. Since my ports tree is up to date and I need to update the system and ntpd takes less time to compile then FreeBSD this was my method of making sure it was up to date.

#cd /usr/ports/net/ntp && make install clean

That netted me ntp-4.2.2p3 which should be fairly current. Running portaudit tonite has showed me that python, ruby, and pgp have issues. Checking for outdated ports:

Vectra# portversion -v | grep "<"
fastest_cvsup-0.2.9_3 < needs updating (port has 0.2.9_4)
portaudit-0.5.10 < needs updating (port has 0.5.11)
portupgrade-2.0.1_1,1 < needs updating (port has 2.1.3.3_1,2)
ruby-1.8.4_4,1 < needs updating (port has 1.8.5,1)

Gotta love portupgrade giving some nice tools, gotta do some updates over the weekend of course. The NTP daemon is pretty simple, all the compucated stuff is basically done for you by the program and Network Time Protocol. We need to create a configuration file, being part of the system it’s in the et cetera directory of the root file system (/etc). The only editors installed on FreeBSD I know of are ed, ee, and vi. Ed was the first unix editor I think and probably would be a good choice if your using some type of telitype terminal, for the sake of ease of use I suggest you use ee or vi. PC-BSD and DesktopBSD should include kwrite, kedit, and kate, xedit as well. I personally prefer vi as it’s vim like (funny as vim is supposed to be vi like πŸ˜› ).

Vectra#vi /etc/ntp.conf
#Simple ntpd configuration for Vectra

driftfile /var/db/ntpd.drift

server ntp.bellsouth.net version 2

#Broadcast NTP signals over the LAN
restrict 192.168.1.255 mask 255.255.255.0 notrust nomodify

logfile /var/log/ntp.log

Like many config files and a fair number of scripting languages any use of “#” is a comment. To explain NTP quickly. You have a clock, like all clocks your lose accuracy as time goes on. Infact my wristwatches manual stats that it’ll gain like 0.001 seconds a year. I’m not the most tech-headed person but I’d reckon a machine that’s not up 24/7/365 a year is going to be less accurate them my watch. So we need to “syncronize” our watches to do that we need some thing to sync to, thats where time servers come in. A primary time server should be hooked up to a decent time source, like an atomic clock or GPS gizmo e.t.c. and filter down through things, need less to say primary/secondary time servers should be fairly accurate and NTP takes into account trying to keep it that way between systems. The configuration file specifies my ISP’s time server using the syntax “server Server_To_Sync_With”, you need to query at least one server, two is more reliable but you should be considerate of the server maintainers. The driftfile is used to help store information to keep accuracy of the time. The server is limited to broadcasting on the given LAN with several options (taken from the man page). notrust Treat these hosts normally in other respects, but never use them as synchronization sources nomodify Ignore all NTP mode 6 and 7 packets which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted. We can start the daemon now using the command:

Vectra#ntpd -c /etc/ntp.conf -f /var/db/ntpd.drift

To get this setup at boot time we enable ntpd in /etc/rc.conf, edit it as root in your editor of choice. Add ntpd_enable=”YES” and ntpd_falgs=”-c /etc/ntp.conf -f /var/db/ntpd.drift”, below is a copy of my rc.conf file including the ntpd lines.


# -- sysinstall generated deltas -- # Sat Sep 2 19:29:45 2006
# Created: Sat Sep 2 19:29:45 2006
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="Vectra"
ifconfig_xl0="DHCP"
saver="daemon"
sshd_enable="YES"
usbd_enable="YES"
update_motd="NO"

#Services

#enable CUPS
#cupsd_enable="YES"
#background_cupsd="YES"
#boot samba
#samba_enable="YES"
#enable ntpd
ntpd_program="/usr/local/bin/ntpd"
ntpd_enable="YES"
ntpd_falgs="-c /etc/ntp.conf -f /var/db/ntpd.drift"

#Security

#clear temp files
clear_tmp_enable="YES"
#Make sendmail listin only on the local host
sendmail_enable="NO"
#Ignore ICMP redirect packets
icmp_drop_redirect="YES"

I’ve organized it in the form of things that came standard, services, and security for now. To sync my computers with Vectra I’ve to set them up to use ntpd with the FreeBSD box as the time server. If you’ve got to sync multiple machines you should use one as a local time server and sync the others on it rather then say ask your internet time server for the time 10 times ! Also you can use ntpdate timeserver for a one time update instead of running ntpd on the clients.

Ok, I think I’ve accidently not done my history test enough, time for bed I’ll worry about getting windows clients syncing off it and the box updated tomorrow !!!

PC-BSD Quick Guide

This is the draft I sent in for the PC-BSD Quick Guides 4th chapter, I’ve replaced my HTML Comments with C Style /* Comments */

Common tasks

In this chapter we will go over a number of common tasks faced by every day users and administrators. We will discuss such matters using plain English and describe it using graphical user interfaces and the command line interfaces as well as configuration files. This will allow you to chose which method you prefer and to be more productive.

We have broken down common tasks into the following:

  • Installing applications
  • Adding new users
  • Adding custom fonts
  • Downloading system updates

Installing Applications

There are several methods of installing software on a PC-BSD system. Each method will be discribed in more detail below.

  • PBI Installer, the easy way
  • Packages, the quick FreeBSD way
  • Ports, the traditional FreeBSD way

When you install software from a PBI you will be presented with a simple graphical way to install software. Simular to many other popular operating systems you just click and go. Since PBI programs are created from traditional FreeBSD ports and packages they are fewer and less up to date then ports.

Ports and Packages are the traditional ways of installing software. You can get the most up to date software by compiling from ports. You may also quickly install allot software using packages, but not all software is available as a package or PBI.

Installing software via PBI

When you install a program through the PcBsdInstaller system it is placed with all required files in it’s own folder in /Programs and linked into the system. This is very simple and safe to the persons system as person is not changed more then necessary to allow the packages to function.

/* Update the URL if it ever changes */

To install a PBI we need to go to the PBI Directory and download a program

/* Stick screen shot(s) of PBIDir here */

Once the download is completed simply double click on the file to launch the installer. It will prompt you once for the super users password before beginning the installation process. This is to ensure you are installing the program and not any one that may have sat down at your computer. It’s both effective as a security measure and parental control.

Click next at the welcome screen, you will then be asked to read any license agreements that comes with the program you are installing. Check the I agree box and click next to continue installation. You may have the options of placing icons on your desktop and entries in the PBI Programs section of the K-Menu. Check all boxes that apply to what you wish done and click install. Once it has completed the installation click finished and tryout your program

If at a later date you wish to add an icon to your desktop for some thing you did do during a PBI install, or when using ports/packages you may do so by right clicking on the desktop and selecting “Create new link to application”. This will open a menu where you can set thename of the icon, it’s picture (click the cog image), click the Application tab. Here you will have to set the program you wish to create an icon for, you can also set a comment, disrisption, work path, and file types as you feel necessary. You can also install in text mode from a console by changing directory to the location of the PBI and run the following as the super user.

./PBI_File -text

Fetching packages

Packages are prepared files for installing software, they install software into the system and can cause dependancy issues. The package system is comparable to RPM, Dpkg, and Apt-Get used in several Linux Distros. Installing packages requires you to open a console with root permissions. You can type kdesu konsole in a run dialog from the K-Menu or open a konsole from the K-Menu in super user mode, or open a konsole and type su and press enter. You will be prompted for the root (super user) password, it will nto display the password on screen for security reasons. After switching to the super user account you have complete access to the system and can install software at will.

You can install a program using the package system like so:

#pkg_add -r irssi

will install the irssi program with all required files but not update the K-Menu or desktop. You can generally find the binary (executable) in /usr/local/bin, configuration files in /usr/local/share// or your home directory and the libraries (like .dll) will be placed into the system as needed and shared between applications. This is true for ports as well, the PBI system is favored by users wanting to avoid this at the minor expense of some disk space. As PBI install all files into /Programs/ but ports are kept up to date and contain many more programs.
/* Special thanks to adamant1988 on #pcbsd for coming up with the package. I don’t think a CLI IRC client is right for this but I needed a quick program thats not a PBI yet */

You can uninstall a package by using the pkg_delete command and the name and version of the package or a wild card.

pkg_delete irssi-0.8.10_2 and pkg_delete “irssi-*” are equavilent.

You can get info about an installed package the same way using the pkg_info command.

#pkg_info “irssi-*”

Installing software using ports

Traditionally BSD installs software from source, the ports collection is a easy to use system that makes this as painless as possible. You first need to install an up to date ports collection before you may use ports to install software. New users coming from Gentoo GNU/Linux will find this similar to the Emerge system which is based on FreeBSD ports.

To install the ports collection click on the K-Menu and navigate to settings, administration, PC-BSD System. Enter the super users password to access the admin panel and click on the tasks tab. Now click fetch ports and it will begin downloading the necessary files and installing them.
This will take awhile depending on your Internet connection and Processor speed.

/* picture of the tasks tab here */
/* Probably delete this part for the quick guide */

If you wish to do this from the command line open a console as the super user as described in fetching packages and run the following command

#cvsup -g -L 1 /root/ports-supfile

You can also use the portsnap method

#portsnap fetch && portsnap extract

If you install ports using portsnap you should not update the ports collection with cvsup, instead use:

#portsnap fetch && portsnap update

if you installed ports using cvsup you may update them in the same way as before:

#cvsup -g -L 1 /root/ports-supfile

You can edit the supfiles and set a download mirror closer to you, please see the FreeBSD handbook for more information on using CVSUP

Now that the ports collection is installed if you look in /usr/ports you will see a simple tree structure of folders. The structure is in the format of catagory, program name.


Adding new users

The two best ways to add a new user to your system is by using the User Manager program or the adduser script. User manager is a graphical program and easy to use with the mouse. Adduser is a very flexible command line method.

Open the K-Menu and go to settings, Security & Privacy, User Manager. Here you can add, remove, and lock users, change the super users (system) password). To add a new user you will need to have a user name and password, you may also input the full name of the user for reference.

/* Insert screen shot of user manager */

To add a new user with adduser open a konsole in super user mode and run:

adduser

Here is an example of running the adduser script, the options listed in side brackets are the default used when merely pressing enter to continue.

Dixie# adduser
Username: joe
Full name: Joe User
Uid (Leave empty for default):
Login group [joe]: wheel
Login group is wheel. Invite joe into other groups? []: operator
Login class [default]:
Shell (sh csh tcsh bash nologin) [sh]: bash
Home directory [/home/joe]:
Use password-based authentication? [yes]: yes
Use an empty password? (yes/no) [no]: no
Use a random password? (yes/no) [no]: no
Enter password:
Enter password again:
Lock out the account after creation? [no]: no
Username : joe
Password : *****
Full Name : Joe User
Uid : 1002
Class :
Groups : wheel operator
Home : /home/joe
Shell : /usr/local/bin/bash
Locked : no
OK? (yes/no):

Here we have added a new user named joe to the groups wheel and operator giving him greator access to hardware and the ability to switch user to root, that is run programs as the super user. The choice of shells include the bourne SHell, C Shell and the Bourne Again SHell. More shells can be installed using PBI, Ports, or Packages. You should only add users to the wheel or operator groups that you want to have administrator access to the machine. An example of this would be some one you would give the super user password too, is someone who should be in the wheel group. Some one who you do not want to have the ability to switch to the super user should not be in the wheel group!

. An example of this is a child you may not want to be able to modify important files should not be in the wheel group. While a spouse you wish to be able to install software should be.


Adding Custom Fonts

To install additional fonts that you have downloaded from the Internet. Open the K-Menu and go to Settings, System Administration and click Font Installer. You can install personal fonts for use with your account or you can install fonts to be used system wide. Only the super user can install system wide fonts.

/* Screen shot of font installer, admin mode */

To install a new font click add font and locate the .ttf font file you wish to add. If you click administrator mode you will be prompted for the super user or “root” password. Then you will be able to view and add system wide fonts in the same was as personal fonts. The font installer program only shows you fonts installed for yourself when not in administrator mode.


Downloading System Updates

Updating a PC-BSD system is a very simple process unlike many GNU/Linux distributions, PC-BSD is updated in a similar matter to installing software using PBI. You can check if your system is up to date by running the Online update utility.

Open the K-Menu and browse to Settings, System Administration and click Online Update. It will prompt you for the super users password before allowing you to alter the system. You will have the option of setting the system to check for updates at a specified time daily or weekly, default is not to check. However the system will always check for updates at startup and you can manually check here by clicking “Check now”. After editing any settings here be sure to click the “Save” button to save your changes. You will then be able to select, fetch, and install any updates it finds.

/* Screen shot of Online Update */

To manually download an update go to www.pcbsd.org and find the download system updates section (under the downloads menu on top of the site. As of this writing you can obtain updates from here. Download the patch for your version, such as PC-BSD 1.11a to 1.2. Once the download has finished double click on the PBI file to begin the installation, it works just like installing a PBI but simpular.

DO NOT cancel the update while a patch is running, restart the computer or other wise disrupt the update even if it appears to be stalled, an update can take time to complete. You will be notified when the update has been completed and be asked to reboot for all changes to take effect.

I’m very tempted to try and put Python + QT to work. A good reference should be able to deal with the diffrences between the C Standard library and what Python offers. I know KPorts is available as a crazy PBI for PC-BSD to give people a gui frontend for ports/packages but. While it gets the job done it’s too darn crashy !

If I could manage to do it (would be learning my first toolkit), a frontend thats got full support for portupgrade and portaduit, strong searching and is reliable + configurable is nice. Functionality, Ease of Use, something thats easy for a newbie but powerful enough to be a professionals tool. Maybe add support for pkgsrc or emerge and stuff in the future. I dunno if I could with how much I know about programming now but there’s always the future.

If I did it I’d want to try and keep things tidy, like so:

Implement code to manage ports

Create a graphical interface using QT

Trim things to allow a great deal of seperation between functional code and user interaction so that it’d be possible to have diffrent GUI’s but not have to rewrite all of or edit most of the code that actually does the job.

Hoozah for ports !

Well after installing samba3 from packages I was never quite able to get samba working, before when I had tried on an older *BSD install I was able to get it working up to the point of asking for a longin.

Ripped out all the pkg’s and sterilized the system, only cvsup-without-gui and fastest_cvsup installed via pkg_add -r. Installed the full ports collection (I had only install a few parts of it before) and built samba.

cd /usr/ports/net/samba3/
make install clean
It asks what options you want to build support for, defualt I saw no need to change but added support for syslog.

OPTIONS=   LDAP            "With LDAP support" on 
ADS "With Active Directory support" off
CUPS "With CUPS printing support" on
WINBIND "With WinBIND support" on
ACL_SUPPORT "With ACL support" off
AIO_SUPPORT "With experimental AIO support" off
FAM_SUPPORT "With File Alteration Monitor" off
SYSLOG "With Syslog support" off
QUOTAS "With Disk quota support" off
UTMP "With UTMP accounting support" on
MSDFS "With MSDFS support" off
SMBSH "With SMBSH wrapper for UNIX commands" off
PAM_SMBPASS "With PAM authentication against passdb backend(s)" off
EXP_MODULES "With experimental module(s)" off
POPT "With system-wide POPT library" on

Defualt was ldap, cups, winbind, utmp, and popt.

She took about a hour to an hour and a half to compile on Vectra, which is a 500Mhz P3 and 384MB Ram (-8mb for video card). I don’t really mind using ports, actually I love ports it’s just a bit slow on older hardware. Still even with my desktops Pentium D 930/2GB fast ram I’d not want to compile OpenOffice, Xorg or KDE/GNOME. Since it’s late and I’ve got to be at work tomorrow (today) I did a quick google and found this link and followed it as a base of what options I’d need in my smb.conf.

Note that when building samba at the end it gave me

NOTICE: This version of port has changed location of Samba password
===> NOTICE: (smbpasswd) directory. Files in ‘/usr/local/private’
===> NOTICE: have moved to ‘/usr/local/etc/samba’.
===> Found saved configuration for samba-3.0.23c,1

Since this is BSD and not a GNU/Linux disto samba is third party software installed via ports, which basically means look under /usr/local/ for things not the root directory (/) with FreeBSD. So it’d never be in /etc/ like on some GNU/Linux systems. I created a basic smb.conf in vi, I’ll use cat to show it.

rstf@Vectra-%cat /usr/local/etc/smb.conf
#Samba config file for Vectra II

[global]
#workgroup, server name, and encrpy the passwords
#================================================#
workgroup = BSDNet
netbios name = Vectra
#encrpyt passwords = yes

#===================Shares=======================#

[files]
path = /usr/home/samba/files
read only = no
browseable = yes
public = yes

After running testparm on the configuration file I found out that the encrpyted passwords thing was trainsient so I commented it out. Don’t ask me why I chose BSDNet, it’s my SSID for my Wireless network and, well most of my stuff is running BSD πŸ™‚
Vectra is so I know it’s on my HP Vli8 500 (Vectra II). The share is named files since thats what I plan to put there, I thought /samba/files would be good but it didn’t feel right with the directory structure, /usr/local/samba/files maybe but /usr/home/samba/ seemed a good enough place to put LAN wide shares. Made the directory like so

mkdir -pm 777 /usr/home/samba/files

To setup my *BSD user I ran adduser and gave myself a personal user on the box -> No need to put your self in a special group although I did consider using nobody as an option. I also always use a User ID (UID) of 1988 when possible so I know it’s my account. Added the right data for samba

smdpasswd -n Terry

Note that the username and password should be the same as the box you will be accessing the shares from ! I’ll worry about tighting security when I have more time to work on the box. Supprisingly a portaudit gave warnings for the samba package but none for the port.

Check if smbd is running, I used the sockstat command to check, it was running so:
/usr/local/etc/rc.d/samba
restart or stop then start isntead of restart.

On my laptop I tried to join using smbclient and was amazed, go ports !!

Terry@Dixie-%smbclient //Vectra/files
Password:
Domain=[VECTRA] OS=[Unix] Server=[Samba 3.0.23c]
smb: >

Very much to my joy it was a home directory I could not cd out of, I’ll need to toy with this later and probably I’ll chgrp the files share and my user to some proper group that I can use for this.

RELATED TODOS:
Test Samba from Windows (Which is why I need samba)
Secure samba as much as possible while keeping with what I need open
Move some files over
Get ready to cups and print or kill at some point & share it.
Recompile kernel and setup pf e.t.c.
Continue with implementing what ever security proceedures I can think of
Try to gather as much information about the system from another machine and try to gain shell access to my Vectra simula-illictly, then seal any holes I might’ve found or can think of as part of operations “Break in” and “Onion”. It’s my computer so it’s my right to be able to test my own security measures rather then wait, watch, and wonder for it to be compromised. Although I doubt any one would bother even if they could easily, it’s good expirence to gain & fun when it works or has a logical reason for not working.

Time to sleep

Memlogging

I can’t remember how on earth I got in to programming dang gum it. When we got our first Pentium PC about 2000 or 2001. She had Win98 in a FAT16 partition, like a 250MB hard drive, 32MB RAM, and maybe a 133Mhz clock speed. I looked over the system, all the menus and stuff. Usually I didn’t toy with changing stuff for fear that if I fouled it up Ma would kill me. It was technically her E-Machine, and my replacement for WebTV (Yes I first browsed the WWW on one). I spent upwards of 8 hours a day looking through Windows and surfing, mostly Mobile Suit Gundam stuff and made a great study of the One Year War era (I had just learned their was more then Gundam Wing). After awhile the box got a bit cranky as we didn’t even know how to power it doen properly. We we’re told how with out first (a Tandy 1000) not this one. Eventially the HDC or Hard Drive Controller failed, we then we’re given our pastors old PC.

A Packered Bell 1998 machine with like a PII 233Mhz, 64mb of RAM, 2.4GB drive & a dual boot of Win98 and MS-DOS. Never used the DOS for fear of not being able to reboot into Windows and getting killed. When it’s copy of Windows died we got a Dell 4550, P4 2.0Ghz, 256MB RAM, 120GB drive, CD-Burner and WinXP. I was of course up-set with XP but estatic at the machine, never knew they had gotton so powerful. January 2002 I got my first PC Game and started a war with ma (hates idea of PC Games). I eventially got into gaming and made a few friends, got more and more into the computer after awhile.

Eventially for some fricken reason I can’t remember :! got into programming. A friend I met & trained with in one of my games who was into Python showed me this document one day and changed my path. I started to see the diffrence between the “Hackers” I’d seen and delt with. (Script Kiddies and P.I.T.A. Ballock heads) we’re not the same as people who, well actually dug computers rather then abused them. I started learning about UNIX and started to repsect people /w computer skills more. Eventially I desided to follow my friends advice and learn to use a unix like OS, he loved Linux and I always wondered about it. Sure enough, having to read the manual before installing type I am. I did *ALLOT* of research and eventually found out I ether would go with Debian, Slackware or FreeBSD and GNU/Linux wasn’t my bag so FreeBSD it was. In my search of what a *nix desktop would look like some how I was blessed with finding PC-BSD, I wanted to learn but I didn’t want to crack my skull open. I figured /w PC-BSD if I turned out to be a schmuck without WinXP I’d still be able to learn at my own pace. Sure enough ma wouldn’t let me repartition her computer. I registored on the techsupport forums @ http://www.pcbsd.com/ and hung around, hoping to grep some information while I awaited away to buy parts to build my dream girl. One of the people we work for (an IT manager) gave me an old PC, Monitor, and Keyboard to install it on when he found out.

I still have that comp and it’s the “Vectra II” lady I ssh around with (best *BSD box I got too hardware wise). After reading allot of the related matter in the handbook I tried to install FreeBSD at 0400 local, forgot to put my user as part of the wheel group and was to darn tired to figured out how to get to root access. Yeah I know, even for a first timer it was bad but heck I’d have been better doing it drunk then so late/early after a work day. Installed PC-BSD 1.0RC1 in the morning, best thing I ever did.

Since then, I’ve learned so much, crap I don’t even need X after I made my self learn to live in a console. I still hang around the forum in the hopes that as I learn I can help some body else to learn, I don’t think I’m half as smart as most of the regulars but I try with the time I got. if it’d give the expirenced users time to anwser some important question I’m happy to deal with simple stuff. If I know it I say it, if I can try or aid some how I try to, if it’s some thing the person should’a looked up I try to link them and give them a summery rather then a “RTFM and go away” approch like I’ve read which I’ve in some forums but never sceen around PC-BSD. I thank my friend and the author of that page very much. It opened me up to allot of learning, I started out on Windows with C++ and bergined out. It gave me the feeling to start learning other languages even while trying to comprohend the basics (and still am compared to a professional programmer). It led me in search of PC-BSD and freedom, waking up to Windows is like booting up and getting “Good morning retard, care to get bossed around again?” which, is not my idea of design. Any software that thinks it knows more then any user could _ever_ know and that it’s omni-portent is a very bad idea. I’ve always liked to know about things I like and how they work, computers of course have always interested me. Until I got on one much to much it never accured to me a computer could be some thing for joe blow, instead of just Ph.D Rocketman. Some how my interest in programming spread out, I dunno how to explain it. From hardware, to software, to the net it’s all a joy. It’s just so awesome, to be able to learn. I don’t know if I’ll ever have enough skills at computers and programming to be able to write any thing useful or really help any one, but I can sure as hell enjoy the ride.

May information always flow freely !

Snakes and Rivers

Starting to learn about python, I’ve always hated python for as much as I’ve seen of it. I’m the kinda guy that likes C/C++, not because of the syntax and loaths Java because I feel it’s to much typing. C/C++ has a very logical style imho. I’m used to stuff like this:

void someFunction(some, params)
{
int somevar = 1;
int comvar = 3;
char anothervar = "something";
if (somevar < comvar) {
cout << anothervar;
}
}

Python feels more like it’d be some thing like:

def someFunction(some, params):
"""About this function"""
somevar = 1;
comvar = 3;
anothervar = "something";
if somevar < comvar:
printf anothervar

So far it’s interesting, never really done much for Object Oriented Programming ether. Well inless you count reading allot of Java a long time back but never writting much.
While I can’t remember why I got into programming, I remember I chose to start off with C++ because I knew it was common and I could find allot, also I found it interesting. Java I’ve read but not written, plenty of reading both about the language and the syntax but I’ve only written like a hello world app. The way I go by how much typing is involved is the Hello world program most tutorials start with. Example / Opinions:

/* ANSI C */

#include <stdio.h>

int main()
{
printf("Hello, World!n");
return 0;
}

// My very first C++ program
#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
cin.get();
return 0;
}

//Simple Hello World program in Java

class HelloJava {
public static void main(String[] args) {
System.out.println("Hello Java!");
}
}

#!/usr/bin/perl
use warnings;

print "Hello, world.n";

#in python
print "Hello, World!"

As you can see, Python was the least involved to print one line of text to standard output. Perl wasn’t so bad, like a shell script + I always use, use warnings with perl. Java doesn’t look bad but 2,000 lines later I think my fingers would wear out. C++ is ok but a bit of prep work, C on the other hand is slightly less. While I reckon doing things in a language is always typing intensive up to a point, how much nitty-typing you need to do some thing short is the Q. Odds are in my book Java is probably better to learn first but C is easier to have to type out things. I must say I do like to hear of app’s done in Java, I can even read it reasonably like a few other languages but I don’t like to use it. I think I’m going to like Python, basically after I started with C++ I got board and switched to Perl learned enough to be able to grasp a few basics (and read it better) then got board. Whent back to C++ studies and started reading about Java. Got tired of C++ and didn’t care for writting Java. Forgot allot of crap from no use, got back into it and tried to learn more about C. Fell inlove with it the second I saw this guide it’s good for learning basic concepts and this guys got a nice sense of humor. I found it useful if not perfect but it did renew my interest in programming. Since then I’ve been playing with C and generally enjoying it.