Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
I want to capture Lame's output histogram to a log file. The problem is that when you redirect to a file, you end up with the raw escape sequences in the file rather than them being executed (for example moving the cursor, causing earlier text to be overwritten). Does anyone know of a way to pipe the output in to something that will replicate the correct escape sequence behaviour before writing the log file?

Adbot
ADBOT LOVES YOU

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
I have to say I'm impressed: using nothing but gparted, I've managed to successfully clone & resize a mixed 120GB NTFS-Fat32-swap-ext3-ext3 drive on to a new 1TB Samsung. There was a slight booting issue due to the priority given to IDE vs SATA drives, and Windows only booting from the first drive. Other than that, it's been a totally painless experience.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
This seems like a trivial request, but for the life of me, I can't find the answer via google:

when using lp, how do I tell it to print something in grayscale?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
-v just prints out the filename and nothing else
-vv also prints out permissions, size, date & time.
It's a bit like 'ls -1' vs 'ls -l'

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
-v inverts the match, so prints all lines that done match. For example, if the comment lines start with a hash....

cat file | grep -v ^#

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

Accipiter posted:

And you wouldn't do grep -v ^# filename because...?

Why are you even bothering with cat?
Pure (and inefficient) habit.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

deong posted:

Cool. I'll try out x64. Squeeze out the most I can out of my aging box heh.
Just yesterday I finally switched to x64 Ubuntu. I installed Flash using these instructions. Despite that fact the opening post says it's only for Firefox, it works for me in Konqueror, Opera and Chromium. The OpenJDK that was installed by default kept killing all the browsers every single time I tried to access anything Java , so I uninstalled the iced tea Mozilla plugin, enabled the Canonical partners repository and installed Sun Java 6.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
I like to use emacs to generate colour-highed pdfs of code. Is there anyway for me to put the follow workflow in to an automated script?

1. emacs <code>.<extension>
2. enable syntax highlighting
3. alt-x, ps-spool-buffer-with-faces
4. switch to correct buffer, save-as, <code>.ps
5. exit emacs
6. ps2pdf <code>.ps

Not being a emacs user, I have no idea if it's remotely possible to automated that side of it.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Are there any decent graphical diff programs for comparing binary files? I an find plenty for text files, but almost nothing for binary.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Overkill here, but because it's useful to know for more advanced commands than deleting;
find . -iname '*.jpg' -o -iname '*.ini' -exec rm {} \;

Pablo Bluth fucked around with this message at 23:47 on Apr 26, 2011

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Tomorrow at work I've got to restore some old data from some DAT tapes. The tape was written before my time so I'm mostly expect it to physically fail or turn out to be written using some esoteric hardware/OS/software lost in time (this week I've already had to deal with making sense of Prime Computer, Inc's alternative ASCII table)

I've never used tapes drives before, so I've been googling some how-tos. Can somebody confirm the easiest sequence of commands to justextract every file off a given tape?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

Grandpa Pap posted:

On a related note, I was bored during a recent evening and thought "Hmm, I haven't experimented around with dual-booting a PC recently."

A ton of research on the Internet later, I now have eight operating systems on my PC. :gonk:

(they are, in order of install: Win7, Arch, Fedora, openSUSE, Debian, Sabayon (Gentoo variant), Linux Mint, Ubuntu)
That's only two OSes ;) Wheres Free|Open|NetBSD, FreeDos, Solaris, Haiku, Aros...

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
I'm having one of those moments when you discover a useful command, then discover a week later you can't remember what it was called and Google fails to remind me....

It's a utility you use as an intermediary in pipe, and allows you to set a limit of the number of bytes passed through before it terminates. During the process, it shows a "rsync --progress" style progress bar.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

haywire posted:

"pv"

Aka Pipe viewer. http://www.ivarch.com/programs/pv.shtml
Thanks, although that not the one I was after. Turns out that was bar.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
That's actually what I did, having initially neglected to check on the basis I didn't think it'd have gone that far back.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

Ninja Dan posted:

Basically I have a LAMP server already set up and running but I need to be able to ftp in and upload files like you would on any other web server. This is my first go at setting up my own server so I'm pretty ignorant as to whether I'd want SSL FTP over SFTP. It sounds like SFTP might be a little more manageable for me so I'll look into that. Thanks for all the advice guys.
If your client machine is also Linux, then sshfs is an excellent invention. Why mess around with ftp software when you can use ssh to mount the server as a local filesystem.

Pablo Bluth fucked around with this message at 21:40 on Mar 10, 2012

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Would another option to be to leave the general ssh on a 5 digit port, and have a work-only white-listed port on 443.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
As a sanity check, you could try running tcpdump on the server just to make sure you're getting the packets from the external address and they're not getting lost.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
I'm using a Raspbery Pi as a secondary wireless accesspoint (using this guide), and it's all working apart from one issue.

Main AP & wired network 192.168.0./24, including RPI-eth0 192.168.0.99
RPI's AP: wlan0 is 192.168.2.1, and it hands out 192.168.2./24 addresses.

The one thing that doesn't work is devices on the main 192.168.0. subnet struggle to talk to those on the 198.68.2. subnet.

code:
From 192.168.2.2 (wireless device on RPI-AP), ping 192.168.0.2 (Desktop) works
From 192.168.0.2 (Desktop), ping 192.168.0.99 (RPi eth0) works
From 192.168.0.2 (Desktop), ping 192.168.2.1 (RPi wlan0) works
From 192.168.0.2 (Desktop), ping 192.168.2.1 (Tablet on RPI-AP) fails with a Destination Host Unreachable
If I run tcpdump on the rpi while I attempt the ping, I see a lot of
code:
ARP, Request who-has 192.168.2.2 tell 192.168.0.2
I can't find any evidence that there is a response from the RPI. So if I run either of the following commands on the desktop machine, it can then find the wireless device without issue:
code:
sudo route add 192.168.2.2 gw 192.168.0.99
sudo route add 192.168.2.2 gw 192.168.2.1
Thus I conclude my iptable rules that I've used to bridge the RPI's two interfaces isn't correctly dealing with ARP requests. The iptable rules I've used, taken from the tutorial linked above:
code:
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
What else do I need to do so that the 192.168.2. subnet is correctly discovered by 192.168.0. devices?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

River posted:

Anyone know of a way I can run dual monitors with Fedora or Ubuntu without everything making GBS threads itself?

One monitor (Primary) runs at 1920x1080 @ 59hz, the other runs at 1280x1024 @ 60hz. Both Samsung Syncmasters, 2233sw and 740n respectively. Graphics card is an nVidia GTS450. I'm connecting the primary with a DVI cable, and the other with DVI but through a VGA > DVI adapter.

I can only seem to have them mirrored, and for some reason on both distributions my primary monitor is stuck in 1600x1200, and the second stuck at 1024x768, I think it's trying to force a 59hz refresh rate on the second one too as it flickers like crazy. I'm stumped.
I had a load of trouble getting Ubuntu to run dual screens reliability; it was always missing the right modes from the GUI or it would work for one boot them break again. My final solution was to put the following in a script then call it from /etc/X11/Xsession.d. At first boot I get a mirrored login screen but the first time I log in, it applies the desired arrangement.
code:
xrandr --output VGA-0 --mode 1280x1024 --output HDMI-0 --mode 1280x1024  --left-of VGA-0 --primary
So my guess for you would be along the lines of (switch left-of to right-of/above/below as required):
code:
xrandr --output VGA-0 --mode 1280x1024 --rate 60 --output DVI-0 --mode 1920x1080 --rate 59 --left-of VGA-0 --primary

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Does anyone know how in LXDE to bind ctrl+down/up to pagedown/pageup, to make up for the lack of PgDown/PgUp keys?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

so loving future posted:

The good reason is that the whole thing is the filename. Extensions are just a convention. There's way way less ambiguity and room for error if you just assume whatever the the user tells you is the filename instead of trying to get clever around 'should I append crap to this???'
Unless you happen to be working on a really old FAT file system with 8.3 filenames... To be fair, with Windows and OSX defaulting to hiding file extensions, people have been trained to have a unreliable understanding of extensions.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Mount the remote system locally using sshfs, then use use your usual file manager?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

DeaconBlues posted:

Is there a hard disk health reporting utility I can run on my little Ubuntu server?

I've got two 2.5" hard disks in there, and one of 'em must be well over three years old.

Something that runs a daily S.M.A.R.T scan (that doesn't abuse the drive) and dumps a report into a file would be great. Even better if I could just run it as a cron job and experiment with different intervals.

I want to be aware when bad sectors start appearing and if I see them rapidly getting worse I can replace the disk.
smartctl is the command line SMART utility ―wrap that in your favourite scripting language to record the data you want and do something useful such as fire off an email if there's an error found.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

Methanar posted:

What is the proper way of finding and replacing a string in all files in a directory? In Powershell I would do something like this.

Here were my attempts.
code:
for file in $(find .); do sed -i "s/input/output/g" $file; done 
Rather than do a find then loop the results, you can get find to directly execute a command each time it finds a file.
code:
find . -type f -exec sed -i "s/input/output/g" {} \; 
{} is where the filename is substituted and \; ends the command string. Find's exec command is particularly useful when you do something like accidentally generate several tens of millions of log files in a single directory overnight.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Finally gave in to the notifications to upgrade from Kubuntu 14.04 LTS to 16 and it seems to have totally borked the system. Guess it's time to download an image and do a fresh install. Is switching distro while keeping the same /home partition a bad idea?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

peepsalot posted:

Ok but is there also any one particular app that will report every relevant thing and fit it on a single screen and does it come installed on the live distro.
lshw. No idea if it tends to come on live cds.

Edit: no idea how I missed the previous post before writing mine.

Pablo Bluth fucked around with this message at 12:24 on Nov 3, 2016

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
You could experiment with Ksnapshot...

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
rsync --progress will give a mb/s stat as it copies. lsusb -v will give you usb stats that will include connection mode.

Pablo Bluth fucked around with this message at 09:15 on Mar 3, 2017

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
lsusb -t might be easier to interpret, each line ends with I believe the current protocol speed in Mbit/s.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Seems to me the main issue (other than the lack of screen width) is the email client isn't using a fixed width font, so I'd send it as a html email with the font set to monospace. If any of your scripts use tab aligned output, piping through expand to convert those to spaces might also ensure more consistent behaviour.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

Zero Gravitas posted:

Does anyone have any recommendations for an equivalent to the windows Remote Desktop Connection to connect to a linux machine on the same network from a W10 machine?
xrdp works for me on a Centos server I maintain, once I figured out how to get it to reconnect to an existing session instead of making a new one each time.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Or a kvm switch.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Why did nobody tell me about Bash's ctrl-r?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
setenforcing 0

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
I know. I was joking that turning off SELinux rather than properly fixing the problem is the modern equivalent to 777 permissions.

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

apropos man posted:

My friend wants to run Kdenlive video editor at work, which is populated with Windows machines.

He specifically wants to run Kdenlive and won't run any other video editor.

Is there a way I could go about baking Kdenlive into a Linux live ISO for him?

I asked him why he didn't just take a netbook to work with him and he said he was gonna buy one but he's wasted all his money on bitcoins and even though bitcoins are rubbish and a handful of retailers would accept them for a netbook he said "no. Bitcoins are for holding" because he's provably clinically insane.
Give him the Windows beta version?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Today's lesson – remember to swap out from an xrdp session to physical access when running do-release-upgrade so it doesn't fall over half way through...

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
You can either do function myfunc {} or myfunc () {}. Something needs to denote it as a function.

Pablo Bluth fucked around with this message at 12:30 on Dec 30, 2019

Adbot
ADBOT LOVES YOU

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
All Hail Perl!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply