Find fields & stores near you!
Find fields and stores
Zipcode
PbNation News
PbNation News
Community Focus
Community Focus

Reply
 
Thread Tools
Old 01-15-2010, 01:48 PM #988
DrewDodson89
 
 
DrewDodson89's Avatar
 
Join Date: Mar 2005
Location: San Diego
Annual Supporting Member
Quote:
Originally Posted by PaintedSaint View Post
I gave up, nothing at all worked. I tried 7 different distros and they all hang at random places. Mainly intitramfs or bridging to scsi drivers or somerather. But i got it all worked out with the use of vm.
Bad HDD or RAM?
__________________

Kiwi!
ಠ_ಠ
DrewDodson89 is offline   Reply With Quote
Old Sponsored Links Remove Advertisement
Advertisement
Old 01-15-2010, 02:24 PM #989
zoink
cats cats cats
 
zoink's Avatar
 
Join Date: Aug 2005
Location: VA
zoink is one of the top 25 posters on PbNation
Quote:
Originally Posted by boomslang View Post
I would use file(1) to determine filetypes, which would also remove the need to depend on file extensions. For example,
Code:
rmullen@lambda /mnt/array/staging/spr10/hdtorr $ file -b Wild\ Russia\ 2009\ 1080p\ x264\ H\@M.torrent BitTorrent file
I think it should be easier to handle that output. Also, I like find(1) to loop through files in a directory. Something like:
Code:
find $DIR | while read file do stuff done
etc

Sorry, don't feel like typing the whole thing out at the moment
file -b works great for torrent files, but for zip it returns stuff like "Zip archive data, at least v1.0 to extract", gz returns "gzip compressed data, was "Geekbench21-MacOSX.dmg", from Unix, last modified: Wed Aug 19 23:57:14 2009" tar.gz returns "proctools-0.4pre1.tar.gz: gzip compressed data, from Unix, last modified: Sat Dec 6 22:18:20 2003".

:/
__________________
Four wheels move the body, two wheels move the soul.
zoink is offline   Reply With Quote
Old 01-15-2010, 02:43 PM #990
boomslang
lo-fi
 
boomslang's Avatar
 
Join Date: Jul 2003
boomslang is a Supporting Member
 has been a member for 10 years
Quote:
Originally Posted by zoink View Post
file -b works great for torrent files, but for zip it returns stuff like "Zip archive data, at least v1.0 to extract", gz returns "gzip compressed data, was "Geekbench21-MacOSX.dmg", from Unix, last modified: Wed Aug 19 23:57:14 2009" tar.gz returns "proctools-0.4pre1.tar.gz: gzip compressed data, from Unix, last modified: Sat Dec 6 22:18:20 2003".

:/
file -b file.zip | cut -d" " -f1

Store the output of that in a variable, run a case statement to operate on different file types?
__________________
shoot the ****: irc.oftc.net #doublethink
boomslang is offline   Reply With Quote
Old 01-15-2010, 04:14 PM #991
Dr. Satan, MD
gimme the loot
 
Dr. Satan, MD's Avatar
 
Join Date: Feb 2009
does anyone know why this is giving me an error that's something like [: not found

Code:
if [ $1 != "old" && $1 != "new" ] then echo blah blah blah fi
Dr. Satan, MD is offline   Reply With Quote
Old 01-15-2010, 04:24 PM #992
boomslang
lo-fi
 
boomslang's Avatar
 
Join Date: Jul 2003
boomslang is a Supporting Member
 has been a member for 10 years
Quote:
Originally Posted by Dr. Satan, MD View Post
does anyone know why this is giving me an error that's something like [: not found

Code:
if [ $1 != "old" && $1 != "new" ] then echo blah blah blah fi
What is the output of "which ["
__________________
shoot the ****: irc.oftc.net #doublethink
boomslang is offline   Reply With Quote
Old 01-15-2010, 04:37 PM #993
Dr. Satan, MD
gimme the loot
 
Dr. Satan, MD's Avatar
 
Join Date: Feb 2009
idk
Dr. Satan, MD is offline   Reply With Quote
Old 01-15-2010, 04:43 PM #994
boomslang
lo-fi
 
boomslang's Avatar
 
Join Date: Jul 2003
boomslang is a Supporting Member
 has been a member for 10 years
O...kay.

[ is an executable that should be found somewhere on your $PATH. If "which [" doesn't have any output, that means you don't have it for some reason.
__________________
shoot the ****: irc.oftc.net #doublethink
boomslang is offline   Reply With Quote
Old 01-15-2010, 04:48 PM #995
Dr. Satan, MD
gimme the loot
 
Dr. Satan, MD's Avatar
 
Join Date: Feb 2009
hmm, i've seen it working elsewhere, i'll post again next time i have access to the code

i'll boot into ubuntu and do some ****ing around with similar things
Dr. Satan, MD is offline   Reply With Quote
Old 01-15-2010, 06:12 PM #996
boomslang
lo-fi
 
boomslang's Avatar
 
Join Date: Jul 2003
boomslang is a Supporting Member
 has been a member for 10 years
So here's the more or less completed mini-CMS site generator script that I wrote for the BU LUG site:
Code:
#!/bin/sh MDEXT=.md # File extension of Markdown files HTEXT=.html # File extension of html files FMT=markdown # Name of Markdown executable LC_ALL=en_US.UTF-8 # Locale environment variable PATH=/bin:/usr/bin:/usr/local/bin # $PATH containing executables for this script PREFIX=/ # What you want to appear before everything in the page header URL=http://lug.bu.edu # Base URL for the page INCLUDE=INCLUDE # Name of file containing order of menu links. You need one per dir. WEBROOT=/var/www export LC_ALL PATH # This generates the menu links. Be careful with non-URL-safe chars. menu() { cat << END <div id="menu"> <ul> END while read curline; do if [ $(echo "$curline" | sed 's/.*\(...\)$/\1/') == "$MDEXT" ]; then # If the last three chars are ".md" base=$(echo $curline | sed 's/'$MDEXT'$//g') # Clip the extension baseurl=$(echo "$base$HTEXT" | sed 's/ /%20/g') # URLencode spaces if test "$base" != "index"; then # Do not display index page in menu if test "$base" = "$2"; then echo -e " <li class=\"current\"><a href=\"$baseurl\">$base</a></li>" else echo -e " <li><a href=\"$baseurl\">$base</a></li>" fi fi else baseurl=$(echo "$curline" | sed 's/ /%20/g') # URLencode spaces echo -e " <li class=\"dir\"><a href=\"$baseurl\">$curline</a></li>" fi done < $1$INCLUDE cat << END </ul> </div> <!-- /menu --> END } # This generates the final page content. If you have to edit universal markup, # do so in this function. page() { mtime=$(date +%s) # Title is working dir unless on home page title=$(echo "$4" | awk -F"/" '{ print $(NF) }' | sed 's/^$/home/') cat << END <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title>[bulug] $title</title> <link type="text/css" rel="stylesheet" href="/base-min.css" /> <link type="text/css" rel="stylesheet" href="/style.css" /> </head> <body> <div id="path">$3</a></div> <div id="container"> <div id="main"> END # Now generate the menu links menu "$1" "$2" cat << END <div id="content"> <!-- Markdown --> END cat "$1$2$MDEXT" | tr -d '\r' | $FMT cat << END <!-- /Markdown --> </div> <!-- /content --> </div> <!-- /main --> <div id="footer"> Page generated at <a href="http://en.wikipedia.org/wiki/Unix_time" title="Unix Time">$mtime</a> seconds since the epoch. </div> <!-- /footer --> </div> <!-- /container --> </body> </html> END } # This processes markdown files if they appear in $INCLUDE files process() { # $1=cwd, $2=baselink, $3=page label # Remove existing HTML files and symlinks find "$1" -maxdepth 1 -type f -name "*$HTEXT" -print0 | xargs -0 rm -f find "$1" -maxdepth 1 -type l -print0 | xargs -0 rm -f echo "Cleaning html and links in $1" # Manage .md files while read curline; do if [ $(echo "$curline" | sed 's/.*\(...\)$/\1/') == "$MDEXT" ]; then echo "Processing $1$curline" base=$(echo $curline | sed 's/'$MDEXT'$//g') # Clip the extension page "$1" "$base" "$2" "$3" > "$1$base.html" else # These will be directories process "$1$curline/" "$2</a><a href='$PREFIX$1$curline'>$curline" "$3$curline" fi done < $1$INCLUDE } if test "$1" then cd "$1" fi cd $WEBROOT process "./" "<a href='/'>/bulug/" "/bulug/"
Results in http://lug.bu.edu and all child pages, XHTML Strict compliant.

There is a file called INCLUDE in each directory in the webroot with the menu items in it, for the webroot the INCLUDE file looks like:
Code:
services about the site index.md meetings.md mission.md who we are.md communicate.md
All the pages are written in markdown:
Code:
# Boston University Linux Users Group ## Contact Us ### bulug-list Mailing List The mailing list is the most popular feature of the BU LUG. To subscribe, you can visit [our Freelists page][5] to perform list-related functions like subscribing, unsubscribing, or changing settings. The mailing list archive is online at the [Freelists Archive][1] and can be searched or browsed for past content. ### #bulug on irc.oftc.net The LUG has an [IRC][2] channel on the [OFTC IRC network][3]. This is not very active, but you may find some people idling there and it can be a good place to coordinate a real-time chat if necessary. You'll need an IRC chat client like [irssi][4]. To join the channel in a text-based IRC client, type: /connect irc.oftc.net /join #bulug For a graphical client, just use the server irc.oftc.net and the channel #bulug . The OFTC network supports SSL (encryption) and IPv6 connections. To connect using SSL, if you are using irssi simply change the /connect command to be /connect -SSL irc.oftc.net and the rest should be transparent. Other clients may need to be told to connect on port 6697. [1]: http://www.freelists.org/archive/bulug-list/ [2]: http://en.wikipedia.org/wiki/Internet_Relay_Chat [3]: http://www.oftc.net/oftc/ [4]: http://irssi.org/ [5]: http://www.freelists.org/list/bulug-list
Now I just have to hook it up to a RCS like hg or git and give people access. Once people are contributing, with a little scheduling and moderation I have a cool wiki.

I know I've showed this site before, but the script has since been rewritten.
__________________
shoot the ****: irc.oftc.net #doublethink
boomslang is offline   Reply With Quote
Old 01-17-2010, 10:33 AM #997
BlitzPA9
 
 
BlitzPA9's Avatar
 
Join Date: Mar 2001
Location: Pittsburgh
BlitzPA9 is a founding member
 has been a member for 10 years
Right on. Nothing quite like rolling your own system. This sort of reminds me of jekyll. You might steal a few ideas to improve your script from there.
BlitzPA9 is offline   Reply With Quote
Old 01-19-2010, 09:53 PM #998
Opie2010
No Snow :(
 
Opie2010's Avatar
 
Join Date: Jan 2009
Location: Orlando, FL
I posted this in the gen. tech forums and someone guided me here.

How long does
Code:
sudo -i
last or do the privaleges go on until the session is killed?
__________________
"Originally posted by Stagger Lee: Homosexual escorts are hot now, but in 5 years your butt hole will be in the same boat as the rest of us. Overworked, worn out, and barely able to keep itself together."
Opie2010 is offline   Reply With Quote
Old 01-19-2010, 10:54 PM #999
boomslang
lo-fi
 
boomslang's Avatar
 
Join Date: Jul 2003
boomslang is a Supporting Member
 has been a member for 10 years
Quote:
Originally Posted by Opie2010 View Post
I posted this in the gen. tech forums and someone guided me here.

How long does
Code:
sudo -i
last or do the privaleges go on until the session is killed?
They will last until the session is killed.
__________________
shoot the ****: irc.oftc.net #doublethink
boomslang is offline   Reply With Quote
Old 01-20-2010, 04:04 PM #1000
auburnfan2015
Tiger Lacrosse
 
auburnfan2015's Avatar
 
Join Date: May 2004
Location: Northern VA
 has been a member for 10 years
Relatively new to Linux here, but I usually have enough knowledge to at least be able to interpret help found on google when I run into problems. This is new, and it has me stumped: my Dell Mini 9 has stopped booting into the GUI. The GRUB menu appears at startup, and it won't boot into either 2.6.31-17 or -14 generic. When I try, the ubuntu logo flashes as if it was going to boot, but then the screen goes black and doesn't budge. Recovery mode opens, but I am not familiar with the shell or it's operations and would rather not cause further problems. Any help would be appreciated, even a link to some help I may have overlooked. Thanks guys!

ninja - running a full version of 9.10, not NR (if that even matters)
__________________
OSST:GDT
stelthvue: good call on the sideburns. ive had mine since i was 7. one time a hair dresser put the buzzers too close to my 'burns. i then stabbed her in the juggular with her scissors. she learned her lesson.
THE_INCREDIBLE_BULK: Gingers turn me on... Gingers with Nilla waffers in their orphuses make my loins splode.
jcdenton69: its the black google so it runs a little faster than the white one... :dodgy:
auburnfan2015 is offline   Reply With Quote
Old 01-20-2010, 04:27 PM #1001
boomslang
lo-fi
 
boomslang's Avatar
 
Join Date: Jul 2003
boomslang is a Supporting Member
 has been a member for 10 years
In the grub menu, pause the timer and manually edit the options of the bootable item so that it doesn't show the splash. You may have to remove something like "quiet" or similar. If this works, you can see at what stage in the boot process failure occurs. Otherwise, boot a liveCD and check your logs in /var/log.
__________________
shoot the ****: irc.oftc.net #doublethink
boomslang is offline   Reply With Quote
Old 01-20-2010, 05:15 PM #1002
Opie2010
No Snow :(
 
Opie2010's Avatar
 
Join Date: Jan 2009
Location: Orlando, FL
Quote:
Originally Posted by boomslang View Post
They will last until the session is killed.
Thanks, that was bugging me for a long time. I'm glad I was pointed to this thread, hopefully I can contribute.
__________________
"Originally posted by Stagger Lee: Homosexual escorts are hot now, but in 5 years your butt hole will be in the same boat as the rest of us. Overworked, worn out, and barely able to keep itself together."
Opie2010 is offline   Reply With Quote
Old 01-20-2010, 10:06 PM #1003
auburnfan2015
Tiger Lacrosse
 
auburnfan2015's Avatar
 
Join Date: May 2004
Location: Northern VA
 has been a member for 10 years
Quote:
Originally Posted by boomslang View Post
In the grub menu, pause the timer and manually edit the options of the bootable item so that it doesn't show the splash. You may have to remove something like "quiet" or similar. If this works, you can see at what stage in the boot process failure occurs. Otherwise, boot a liveCD and check your logs in /var/log.
Ok that worked, but what can I give you that you can help me with? The last error was "No init found. Try passing init= bootarg." then I get the BusyBox built-in shell and am not sure how to go forward from there
__________________
OSST:GDT
stelthvue: good call on the sideburns. ive had mine since i was 7. one time a hair dresser put the buzzers too close to my 'burns. i then stabbed her in the juggular with her scissors. she learned her lesson.
THE_INCREDIBLE_BULK: Gingers turn me on... Gingers with Nilla waffers in their orphuses make my loins splode.
jcdenton69: its the black google so it runs a little faster than the white one... :dodgy:
auburnfan2015 is offline   Reply With Quote
Old 01-20-2010, 10:11 PM #1004
boomslang
lo-fi
 
boomslang's Avatar
 
Join Date: Jul 2003
boomslang is a Supporting Member
 has been a member for 10 years
Quote:
Originally Posted by auburnfan2015 View Post
Ok that worked, but what can I give you that you can help me with? The last error was "No init found. Try passing init= bootarg." then I get the BusyBox built-in shell and am not sure how to go forward from there
That's typically a bad thing. What did you do to your computer just prior the first time you started noticing this behavior?

At the prompt, try running "mount" and reporting back with the output if it's short enough.
__________________
shoot the ****: irc.oftc.net #doublethink
boomslang is offline   Reply With Quote
Old 01-20-2010, 11:49 PM #1005
auburnfan2015
Tiger Lacrosse
 
auburnfan2015's Avatar
 
Join Date: May 2004
Location: Northern VA
 has been a member for 10 years
Ok, output:

rootfs on / type rootfs (rw)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type tmpfs (rw,relatime,mode=755)


Before this started happening, I was just surfing the Internet, closed the netbook, and when to sleep. The next day it had died, so I plugged it in, tried to boot, and ran into this problem. I had been booting into ChromeOS off of a USB stick every now and then, but I don't think that would have caused anything like this.
__________________
OSST:GDT
stelthvue: good call on the sideburns. ive had mine since i was 7. one time a hair dresser put the buzzers too close to my 'burns. i then stabbed her in the juggular with her scissors. she learned her lesson.
THE_INCREDIBLE_BULK: Gingers turn me on... Gingers with Nilla waffers in their orphuses make my loins splode.
jcdenton69: its the black google so it runs a little faster than the white one... :dodgy:
auburnfan2015 is offline   Reply With Quote
Old 01-21-2010, 03:55 AM #1006
travis2k2rf
 
 
travis2k2rf's Avatar
 
Join Date: Jul 2003
Location: NC/VA/??
travis2k2rf is a Supporting Member
 has been a member for 10 years
I have no idea what most of you are talking about, but....

I recently dual-booted Ubuntu 9.10 on my desktop. I have had next to no time to mess with it, but my very brief initial reaction is Linux = awesomeness.

I will likely be picking up a netbook in the near future, which will probably have Win XP on it, and I plan to immediately dual-boot (or solely load if I am feeling dangerous) Linux.

Any tips on where to start "learning" Linux/Ubuntu?
__________________
FEEDBACK:
OLD
NEW

travis2k2rf is offline   Reply With Quote
Old 01-21-2010, 08:37 AM #1007
boomslang
lo-fi
 
boomslang's Avatar
 
Join Date: Jul 2003
boomslang is a Supporting Member
 has been a member for 10 years
Quote:
Originally Posted by auburnfan2015 View Post
Ok, output:

rootfs on / type rootfs (rw)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type tmpfs (rw,relatime,mode=755)


Before this started happening, I was just surfing the Internet, closed the netbook, and when to sleep. The next day it had died, so I plugged it in, tried to boot, and ran into this problem. I had been booting into ChromeOS off of a USB stick every now and then, but I don't think that would have caused anything like this.
So it would seem that you don't have a disk mounted at your filesystem root, which would be why your init system can't be located.

Check your /etc/fstab (cat /etc/fstab). See what partition should be mounted at / - the second field is the mountpoint. Then, compare this to your /boot/grub/menu.lst contents - the kernel parameter "root" (probably found on the line beginning with "kernel" and following the location of the kernel itself) should be the same partition that gets mounted at / according to /etc/fstab. Finally, make sure that the line that says "root (hd0,0)" or something similar is correct - GRUB uses a different disk nomenclature, so this part might seem weird.

Before you check all of this, I would first try manually mounting your / partition to ensure that the disk is not somehow messed up. "mount partition /" where partition is the device name as it appears in your /etc/fstab. Make sure it mounts cleanly and nothing weird shows up on the tail end of "dmesg" or in /var/log/messages.
__________________
shoot the ****: irc.oftc.net #doublethink
boomslang is offline   Reply With Quote
Old 01-21-2010, 09:43 AM #1008
Battleaxe3
Cwaigy
 
Battleaxe3's Avatar
 
Join Date: Dec 2004
Location: Toledo, Ohio
 has been a member for 10 years
Installed Arch on an ole' P3. I get the error operating system not found meaning that the MBR is on the wrong partition correct? I made HDa /boot, installed grub here, and told it to install MBR there, iirc. Isn't that right?
__________________
Cwaigy
Battleaxe3 is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
Forum Jump