Charles The Technician
Wisdom and Rants from a Computer / Network Technician
16th
DEC
Mail Server Fix
Posted by Charles | Filed under Advice, Computer Repair
On our mail server I’ve been going through a freaking LIST (2000+) user names of people who’s email accounts have not been deleted from our email server by our account maintenance software. Recently our server has been running slow and taking 3 hours to deliver email. So after some heavy investigation I found out why.
We have a crap load of people with 5000 emails in their inbox that no longer have an account with us that are recieving 25+ emails an hour.
Our server stores those emails as individual files in a directory and has to count them to check for quota size. Those of you that run Linux try and list a directory that has 5000 files in it and see how long it takes your computer to do it. Yeah now imagine a mail server doing this everytime an email comes in to one of these people that have full inboxes?
So I set about making this list and tried to automate the userinfo lookup by yanking names from this text file and pushing it through to my vuserinfo file which creates output like this:
name: [user name]
passwd: [Some long hash]
clear passwd: [actual password]
comment/gecos: “”
uid: 0
gid: 0
flags: 0
gecos: “”
limits: No user limits set.
dir: /home/vpopmail/domains/[our domain]/[username]
quota: 20000000S
usage: 0%
last auth: Thu Dec 14 02:20:26 2006
last auth ip: pop3
so I can triage the 90%+ users and delete their accounts since they are the problem children.
So I go and try:
cat deactivate.txt | ./vuserinfo > output.txt
nothing
it hates piping, I can’t even pipe single lines into it.
I tried a few other ways and nothing worked.
so I broke down and wrote a shell script.
====================
#!/bin/sh
#
# This takes a text file with usernames seperated out one per line and feeds it through
# ./vuserinfo and strips some of the useless output
#
filename=$1
if [ “$1″ = “” ]; then
filename=De.txt
fi
echo “reading $filename and processing press ctrl-c to end”
rm output.txt
lines=`sed -n ‘$=’ $filename`
lines=`expr $lines - 1`
i=1
while ((i < = lines))
do
readthisline=$i\p
usernamer=`sed -n $readthisline $filename`
./vuserinfo $usernamer > Tempoutput.txt
grep name Tempoutput.txt >> output.txt
grep usage Tempoutput.txt >> output.txt
grep last Tempoutput.txt >> output.txt
grep account Tempoutput.txt >> output.txt
i=`expr $i + 1`
done
rm Tempoutput.txt
cp output.txt /root
echo “*********************************************”
echo “************* Work Completed ****************”
echo “*********************************************”
====================
and it got the work done, so many problems that I ran into on the way since I haven’t written a shell script more then 3 lines line EVER before. This would have been solved if only the file allowed for simple piping.
Fast forward to today, server is running Metric FUCK-TONS (smaller then OMGWTF-TONS, but larger then SHIT-TONS) better, but we still have a crap load more to go.
It wouldn’t be so bad if the accounting software we had didn’t fuck up the inactive customer user name report and toss up error messages because that report became corrupt and I no longer have the install software nor does that vendor even sell the version we are using anymore. (We use Platypus by the way).
Lots of work done, lots more ahead.
11th
DEC
PCLinuxOS
Posted by Charles | Filed under Advice, Computer Repair, Rants, Technology
Previously I’ve been dabbiling through with Kubuntu 6.06 and found that it required a lot of “after market” work to get things the way you want them for basic use which the average user just wouldn’t want to do.
Granted there are things that make these “after market” changes alot more simple such as EasyUbuntu or Automatix but again, this requires some changes the average user (I’m talking windows user) isn’t going to be willing to put up with, that and I really don’t like the way Ubuntu implements root access. People shouldn’t be logging in as root, but if they need to for whatever reason, it’s nice to know that they actually can.
I also recently purchased a $46 850Mhz Dell Optiplex 150 with 256Mb ram, that was refurbished as a toy. I was going to turn it into a web server for an internal shop Wiki and FTP server that would allow us to leave files on this server without having to file share around to different computers and worry about logins.
I put PCLinuxOS on it after someone showed me it and I have to say I’m impressed. Right out of the box it looks like a viable alternative for anyone who is wanting to change from Windows to Linux and not have to worry about digging through a lot of .conf files if they don’t want too. I haven’t tried DVD playback or MP3 so I’m really curious if that is done right out of the box (it looks like DVD playing works out of the box as the necessary packages are pre-installed).
{rant}
The Digital Millenium Copyright Act (DMCA) is evil. Because the DVD format can be considered a method of encrytption for someone to create a free alternative that reads DVD’s they would have to break the encryption to make the software which in America would make them a CRIMINAL. Also to have DVD playback that this person created on your computer would make you a criminal. Though I don’t know of many times it being enforced, this law is stupid, tell your representatives to get rid of it…or in 5 years I’ll run for Senator…AND keep this blog.
{/rant}
So I went ahead and installed it on my main computer and I’m quite impressed. Ran DVD’s flawlessly, was a download and restart away from having the ATI drivers for my video card done up correctly. I put all this on the 3 partitions covering the first 120gigs of space on my 250gig HD. I’m leaving the rest just in the event I decide to go back to duel booting XP or want to try other distro’s for kicks.
In other news I got a kick out of learning how to mount a Apple computers HD for data recovery under Linux. That and I was able to get my hands on an iMac to iOpen the iDamn iThing. I found it to be an iExperience, they use philips head screws for the bottom plate, then switch over to hex screws further in, everything is so tight and close together I can’t believe anyone would want to work on the things but interesting enough once you get the right tools together (I had the hex screw drivers in my trucks toolbox), it wasn’t that difficult. Not as easy as working on a regular desktop (2 screws and your in, 4 screws and the HD is out) but was extremely easy for a first time job. I don’t remember the first time I opened up a desktop computer but I don’t remember it being that easy. Then again I know the parts by sight now. And that was about the time I formatted 2 floppies that contained a pinball game because I was told you had to format all floppies before use.
Yes at one point I was an idiot too…
If you want to play with Linux and give PCLinuxOS a try: Click Here
Love,
iCharles~
6th
NOV
How to make a working* election machine.
Posted by Charles | Filed under Advice, Technology
* By working I mean “Secure, Redundant, Verifiable, Loop-hole-free, tamper-proof, free of BlueScreenOfDeath”
1.) Use Open source and publish under the GPL gaining a programing base of millions of programmers most of whom would love to get on a “mainstream” project. You are trusting the general population to come up with an application that is good for the general public to vote with. Ensure all code is double checked and commented for. I would rather trust the general public with widely open source code then a big name company which can hide a security hole either on purpose or by mistake via obscure closed source methods.
2,) Don’t use Windows (Blue screen of death = lost term paper for you = lost countless votes for a state.) If you need someone to actually explain why this is a bad idea then you’re too stupid to understand to begin with.
3.) Use redundant Client / Server checks. Person votes, that info packet is sent to 3-5 different servers which all send agreeing packets back to the client and display what the server saw. If all 3-5 servers do not agree with what was voted an election official is contacted and that vote doesn’t count but the person has to re vote.
Client Send Vote —> Servers receives vote —> Servers send vote back to client —> Client checks to make sure what was sent by it and what was received by the multiple servers is correct. –> If correct client displays a confirmation box —> if incorrect client is forced to re vote.
4.) Use a verifiable ticket system which prints the vote in plain English and a scan code behind a clear glass window that users must say TWICE is their vote. Once upon the server saying “This is what I received”, and Once upon the ticker tape being printed. Once that ticket is complete it is printed out and dispensed out front for the person to go hand in to the voting box.
Client Send Vote —> Servers receives vote —> Servers send vote back to client —> Client checks to make sure what was sent by it and what was received by the multiple servers is correct. –> If correct client displays a confirmation box —> if confirmed client prints that line —> Client prompts for confirmation –> if confirmed client sends a packet to the vote daemon stating what transaction number and vote is and again is checked by the client which resends a confirmation to the server then moves on –> if invalid printer prints a void ticker and notifies server to void that transaction.
5.) Don’t use touch screens. What the fuck is so hot about touch screens? Use a damn keyboard and a simple menu system. “Select your choice” with the default selected choice being blank so that a held down “enter” key won’t cause the first choice to be selected. Touch screens have to be calibrated and after the general public uses them so often they get dirty, and need recalibration. (Public Service Announcement: Wash your fucking hands)
6.) Use a “clean” network. Servers / Client machines will not have access to the internet nor any machines beyond the server s and client. Each server is firewalled where once each active client sends an “Election Closed” notice all ports used for the transfer of voting is closed. Vote Daemon is stopped and only outgoing traffic is allowed. Using an acceptable MAC address list predetermined and added into the system via a configuration file the server will run periodic checks to determine that the only systems online are voting clients voting servers and optionally a managed switch. The system will also use an innovative “Challenge and Password” system which rotates each time and is preconfigured into the systems. Server 1 will issue out a challenge broadcast packet and all systems will respond with their password for that round. If any passwords are similar then the network is compromised and will shut down.
7.) Use redundant delivery methods from the local voting locations to the parent locations. All servers must transmit all results multiple times complete with a MD5 hash of the data to be received. If any discrepancy appears in this information beyond a simple internet outage then all results must be hand delivered by 3 people from different political persuasions on a burned CD. This CD will be created regardless of the confirmation and will be delivered with the paper tickets.
8.) Redundant databases for vote tally. Use flat files and SQL databases which will be checked for consistency between the servers. Not MS-Access (If you have anything larger then a small database and you use Access as your database…you suck at life, just go ahead and hang your head in shame Diebold (link)…)
9.) All servers are Headless, meaning they do not have an option for a mouse, keyboard, or monitor. And is only activated by inserting a USB drive with an activation code pre-configured on it.
10.) Round Trip confirmation: Client 1 stays on. Once the upload is complete a confirmation number based on an algorithm of votes is called back to the local voting station. This number is 8 digits long and the algorithm is pre-determined by each state and truncated from the right (Cutting off digits on the right) if it exceeds 8 digits.
Example: Absolute Value of (Democratic votes Minus Republican Votes * 32)
This number is typed in to Client 1 which by this time is not networked with the servers but received the correct answer from the servers once the last “Close of Elections” was sent. If this number is correct it displays a confirmation and prints out the certifying letter needed to hand carry the CD’s containing the election results which will be signed by the certifying official and 3 witnesses.
If it cannot be certified then a recount by scanning the tickets is required.
The CD’s + The ticker tapes will then be hand carried to the county office. CD’s stored for archiving and verification if needed.
If the electronic means fails at any given time then all electronic voting ceases at that location as determined by the certifying official and reverts to “scantron” voting (Circle your selection with a number 2 pencil). The key is removed and the server dumps all data to the CD’s Anyone in a voting booth has to vote by paper as their votes will be purged for security reasons.
———————————————————-
I’m sure there are other idea’s, and ways to secure a vote, but this is what I came up with at midnight.
For any person that wants to start this project or use it, I make no claim of ownership or patent over these ideas. Use them as you please.
Best thing you can do is use Florida as a Beta Test, guaranteed if it can be fucked up, they can do it. Just remember to include in “error reports” in there to be studied by the general public.
Now if I can plan out a system in under 2 hours why can’t an entire corporation do the same? I understand the nature of “Vaporware” but come on…
Love,
Charles~
PS: Link to Free Software’s Foundation article on this and GPL V.3 that got me thinking (Link)
21st
OCT
Valid XHTML 1.1
Posted by Charles | Filed under Advice, News
I just spent about 2 hours recoding wordpress and some of it’s attributes for picture alignments. Also loved the fact that the tool who made this template added the VALID XHTML 1.1 link but had all kinds of screwy invalid XHTML attributes like allign=”right” bottom=”0″ etc.
Wordpress also fucks this up by adding align=”blah” to picture alignment instead of stuff like style=”float:right”.
I added javascript that looked at the rel tag in hyperlinks to look for rel=”external” so I don’t have to use target=”_blank” to make a link pop up in a new window (w3c doesn’t like target =”_blank” apparantly. But wordpress uses it.)
I’m working on a wordpress hack to add rel=”external” to the link editer in wordpress so my sidebar links will open up in new windows.
If you know of one let me know, no sense in reinventing the wheel.
All and all I learned a few things, like how to add space between your pictures and your text using the style attribute. margins, who knew?.
style=”float:right; margin-left:10px”
Nice little night of learning, googling, and hacking up wordpress.
Edit: Also removed the rel=”nofollow” bullshit. Sorry “nofollow” was something stupid google came up with, I tend to deitize google but that was a stupid idea guys.
Love,
Charles~
PS:
That’s right bitches~
11th
SEP
Virus / Spyware removal.
Posted by Charles | Filed under Advice
To: CharlesTheTech@hotmail.com
From: John_Doe@yahoo.com*
Subject: Why do people get Virus and / or spyware.
Charles,
I recently had a run in with an infection on my machine and I wanted to know, generally what causes virus’s and spyware, why do we get them and how can we avoid it.
Love the website
John Doe*
*Name changed to protect the innocent.
Alright John Doe,
If you asked someone what website catagory has the worst chance of gaining a virus or spyware from most people would instantly say “Porn sites”. Good guess but it’s actually children / teen websites (though porn comes in a 3rd). When your children are on the internet they will get pop up’s like “Punch George Bush for a free IPOD”, “Swat the fly for a free ringtone”, or “Prove you can breath for a free business degree.” alot of us just go “I don’t care about that” and move on. But a child or teenager goes “OOH SOMETHING FOR FREE!~”. Think about it, how often have you purchased cereal, only for the free toy that’s in it? How often have you walked past a display that you didn’t even glance at but your child almost wet their pants with excitement? These things are designed to grab the attention of children and teenagers.
A lot of these programs as part of the contest will ask you to install software in the agreement that NO ONE EVER READS if they wish to continue with the contest. This is where a lot of spyware comes from. Some spyware is malicious and others just report back to base where you go to, how long you visit sites, what ad’s you typically respond to, and what sort of monetary activities you do online (Banking, Purchasing, Budgeting, Tax’s).
The second most prevelent source of virii and spyware is typically where the most virii come from. File Sharing software. Kazaa’s free version is a great example of where some spyware comes from, as part of it’s licensing agreement it installs some spyware that will pop up an offer every so often (like every 15 seconds).
People think they can download “hacked” versions of Microsoft Office, AutoCad, Visual Studio Professional Edition, and other software suites which costs in the upper 3 digits, as overpriced as they are for free. What they don’t realize is people like to screw with people and put stuff that periodically deletes a system file a day (effectivily playing russion roulet with your system) but have it look like the install folder for one of those programs I mentioned. WAREZ sites are bad about this as well.
How can you stop this from happening to you? Watch what your children do online, don’t let them click on those little links that I mentioned, beat them everytime they go to “Hello Kitty” website (too…much….pink, must…destroy…all…children), and don’t think you can get something for nothing. Stay away from file sharing, most people only use it for free music downloads anyways which is illegal but FUN. (Make sure you only download MP3 files).
Hope that answers your question John Doe.
If you have any questions or just want me to make fun of you as well, write me at
CharlesTheTech@hotmail.com
Love,
Charles~
1st
SEP
Non-Rant
Posted by Charles | Filed under Advice
This blog is one giant rant, get used to it. This doesn’t necessarily mean I hate my job or hate people in general, I just don’t tolerate people who are satisfied in ignorance.
I don’t expect everyone to be a super geek, but if your going to use something every single day, get some basic ACTUAL knowledge on how it works, what keeps it working, and how to maintain it.
There should be no reason someone has 5 lbs of dirt come out of their computer unless they drove with the computer strapped to the grill of their truck and drove through dirt roads behind 3 other trucks.
Own a shop vacume? Take that shop vac and put the hose where it is blowing, take the side off your computer and blow all that dirt off like that.
Own a compressor? Do the same thing but don’t use more then 85 PSI.
None of the above? Canned air from walmart or whatever.
There should be no reason someone has more then 3 instances of spyware on their computer and even 1 virus. Here’s the trick: Stay away from porn sites, don’t download anything and everything from your email from people you don’t know.
use Anti-Vir (Link), yes that’s right FREE anti virus which in my opinion is better then Norton, doesn’t eat up resources and if you follow the above rules is even more effective then Norton.
use Spybot search and destroy (Link) again free software, updated regularly and has a nice immunize feature.
use AdAware SE (Link) I recommend both Spybot and Adaware simply because the accepted rate that instances of spyware and adware is caught is 80%, with using 2 separate programs you get over lapping protection.
Run full scans using the above software once a week and you shouldn’t have any problems.
DO NOT download a popup blocker from a pop up…think about it, it’s like trying to buy “insurance” from the mafia.
Stay away from WinAnvtiVirus 2006. Don’t buy pro edition, and if you have already do a charge back, it’s worthless software which detects false positives then says “Buy pro to get rid of this”, it’s deception and extortion.
Defrag (yes I said it), about once a quarter or every time you change your oil on your vehicle.
Have a nice fucking day,
Charles~