Skip to forum content
CrunchBang Linux Forums
A discussion board for CrunchBang Linux users.
Search options (Page 3 of 56)
ok this one should be good:
find /your/path -ctime -2 -type f | nawk '{split($1,title,"s[0-9]");gsub("\."," ", title[1]);print title[1]}' | tee /tmp/file | uniq | while read file; do echo $file `grep -c "$file" /tmp/file`; done
here's some example output
echo -e "Pioneer.Two.s01.e01.avi\nPioneer.One.s01.e01.avi\nPioneer.One.s01.e01.avi" | nawk '{split($1,title,"s[0-9]");gsub("\."," ", title[1]);print title[1]}' | tee /tmp/file | uniq | while read file; do echo $file `grep -c "$file" /tmp/file`; done
Pioneer Two 1
Pioneer One 2
OIFS=$IFS;IFS="
";for file in `find /your/path -ctime -2 -type f -printf "%f\n" | nawk -Fs '{gsub("\."," ",$1);print $1}' | tee /tmp/file | uniq`; do echo $file `grep -c "$file" /tmp/file`; done;IFS=$OIFS
you need the enter after IFS=" it sets the field seperator to newline. It's still gonna take some work to get totally right because right now it just splits on "s" which wont work with an s in the filename. I'll work on it a little more when I get back from work.
should be pretty easy:
${execi 60 find /media/TV -ctime -2}
should give you a list of all files created (or modified I believe) in the last 3 days. You can change the 60 to whatever time interval you would like.
probably the easiest way to monitor the backup is at the end of the rsync script have it write the status to a file in your home directory. Then for your conky just have it cat that file.
once you learn how they work they aren't that bad too work with. I usually use awk just because I'm more familiar with it. Just read like a half hour a day and you'll get em in no time.
just checking if my post worked for you...it should format it how you requested...
Thanks
I can't take credit though. It's from fight club, some very true quotes in that movie.
I think that's what keeps everyone coming back. So many friendly and intelligent people here 
Here you go
nawk -F'>' '/HREF/ {sub(/<\/A/,"",$3); split($2, url, "\""); print $3 "\n " url[2]}' s-11_bookmarks.htm
you should probably be able to find it in the output of the lspci command
gutterslob wrote:Core i7, I assume?
I think a nice little OCZ or Intel SSD combined with that processor and Ubuntu's inclusion of ureadahead will probably make your grub-to-desktop time faster than your Bios-to-grub time 
BTW, did you soften up Arp's Lotus wallpaper? I remember it looking a bit different.
I actually have an ocz vertex in rma right now, it's going in once I get the replacement back. It was running my media center, but now I have that running off a thumbdrive, which actually works pretty well and free's up another slot for a storage drive.
All I did to the wallpaper is crop it too widescreen... maybe I set the quality lower without realizing it and it softened it up or something... Thanks again for all the themes you put out, they are awesome. Oh and yes it's an i7...I'm super happy with it. I had been running mostly AMD but this rocks.
here's the wallpaper too http://arpinux.deviantart.com/art/lotus
-139198224 credit goes to arpinux.
it's plants vs zombies...pretty addictive
it's a windows game though, but it runs in wine pretty well
finally switched to one of gutterslobs themes, love it... new comp running 10.10 with openbox.

dirty:

it would be possible if the songs had good file names or id3 tags...basically you could have the ~/.mpd/cover.jpg be a symlink to the current cover. The script could change the symlink when the track changed...probably not the best solution, but it should work ok.
no problem, I like figuring stuff like this out. I wrote up this python script also that won't give you a division by zero error and shows whether it is charging, if you want to use it instead.(it also uses /sys/class/powersupply instead of /proc/acpi/battery)
#!/usr/bin/env python
import os, math
from decimal import *
rate = 0.0
batteries = os.listdir("/sys/class/power_supply")
output = "No Data"
for battery in batteries:
if "BAT" in battery:
status = open("/sys/class/power_supply/%s/status" % (battery)).read().strip("\n")
if "Discharging" in status:
energy = Decimal(open("/sys/class/power_supply/%s/energy_now" % (battery)).read())
power = Decimal(open("/sys/class/power_supply/%s/power_now" % (battery)).read())
if power > 0:
hours = math.floor(energy / power)
minutes = math.floor(((energy % power) / power) * 60)
output = "%.0f hours %.0f minutes" % (hours, minutes)
else:
output = "Gathering"
else:
output = status
print output
here it is with the correct math....
${execi 60 cat /proc/acpi/battery/BAT*/state | awk '{if ($0 ~ "present rate:"){rate = $3} if($0 ~ "remaining capacity:"){cap = $3}} END {printf "%d hours %d minutes\n" ,(cap / rate), (((cap % rate) / rate) * 60)}'}
you'll want to change the 60 in execi 60 to whatever interval you want...that was just for example....
this should get you what you want, tested on ubuntu 10.04 though. minor tweaking of output may be required....
${execi 60 cat /proc/acpi/battery/BAT*/state | awk '{if ($0 ~ "present rate:"){rate = $3} if($0 ~ "remaining capacity:"){cap = $3}} END {printf "%d hours %d minutes\n" ,(cap / rate), ((cap / rate) % 60)}'}
edit: hold off a minute on this one, the math for figuring out the minutes is wrong
dpkg -l lists installed packages
grep "^rc" looks for any packages that start with rc
tr -s ' ' gets rid of extra whitespaces
cut -d ' ' -f2 selects the package name
so basically it removes any installed packages that the line from dpkg starts with rc. Those are programs that have been uninstalled, but the config files are still present. Here's an alternate script to do it http://joysofprogramming.com/remove-packages-marked-rc/
well I worked for a while on what was supposed to be a quick python script to do this for you. I haven't had much experiance with the csrf protection built into punbb before though and keep getting a token error. If anyone knows how to open a connection with python, read the data, then post I think that would work(without closing the connection, I think it regenerates a token with each connection). Anyway here's what I had come up with for logging in(still not working and I'm taking a break)
#!/usr/bin/env python
import urllib2, urllib, cookielib
username = "your username"
password = "your password"
loginUrl = "http://crunchbanglinux.org/forums/login"
csrfToken = ""
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
loginPage = opener.open(loginUrl)
for line in loginPage.readlines():
if "csrf_token" in line:
csrfToken = line.partition('value="')[2].split('"')[0]
data = urllib.urlencode({'csrf_token': csrfToken, 'fld1': username, 'fld2': password})
loginPage = opener.open(loginUrl, data)
for line in loginPage.readlines():
print line
well if you don't want it connected to the internet there's probably two options, one if your router supports it you could set it up to not allow external traffic to and from the server. If not you could set up a second router with no external connection, but you would have to switch back and forth between networks or have two network cards in your client machines, so this probably isn't the best option. You could also setup the firewall on the server to not allowing any traffic outside your internal network.
For the actual file sharing samba is relatively easy to set up, if you need help there are several good guides out there. For backups on the windows side on my only windows machine I'm just using the built in backup software in windows 7. For the linux box's there are a couple good programs, I've used backintime and pybackpack, both are prety good. If you want to learn more you could write some scripts using rsync to do the backups. For ftp I can't recommend any servers, I usually stay away from ftp and use scp or samba shares for transfering files.
well with debian and ubuntu if you get the server version there wouldn't be a big difference just for a file server, I would pick wichever you're more familiar with. To know what tips to give I would need to know more about your network. Are there windows machines? Mac? or just linux? Would you be using it strictly for file sharing, or for torrents, backups, and other duties as well?
something along these lines should work:
awk -F"%" '{if($2 != ""){print $1}}'
only problem is I'm not sure with a process that has it's own progress indicator like that, if you pipe it through something like awk or sed, if it will refresh or just run once.
here's a guide for arch, but it should all still apply. http://wiki.archlinux.org/index.php/Con
em_to_RAID . Definately follow the warning about making a backup first though, I've lost too much stuff playing around with things like this. Good luck
(the only change I would make from the guide is instead of doing it in single-user mode I would do it from a livecd)
I'm playing around with a btrfs root partition on maverick right now, everythings going good(cross my fingers). Should work well with statler too though, the original guide I followed was for debian.
I'm a big fan of white rabbit myself
Posts found [ 51 to 75 of 1,389 ]
Forums powered by PunBB. Hosted by Linode.
Copyright © CrunchBang Linux.
Proudly powered by Debian GNU/Linux.
Debian is a registered trademark of Software in the Public Interest, Inc.