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
Big Bowie Bonanza
Dec 30, 2007

please tell me where i can date this cute boy
I have vsftpd set up in CentOS 7. I can connect to it fine locally on port 21. I've set up port forwarding for my VM and it is bridged so it has its own LAN IP. I can't seem to connect to it from my public IP. I've disabled my firewall completely and nothing seems to work. Does anyone have experience with this?

Adbot
ADBOT LOVES YOU

spankmeister
Jun 15, 2008






FTP through a NAT firewall presents a few problems. Your client will need to use passive mode (PASV) to get trough a NAT firewall. However, if you have double NAT then that won't work without additional magic.

SamDabbers
May 26, 2003



Set up chrooted SFTP instead. It's better in every single way: encrypted, NAT-friendly, and public key authentication, to name a few.

ToxicFrog
Apr 26, 2008


Misogynist posted:

It isn't the 1970s. Anyone writing actual software outside of a PDP-8 is referring to Perl-compatible regular expressions unless they've specified otherwise.

:shrug: In the places I hang out Perl regular expressions are always "PCREs" and someone just saying "regexes" is referring to either POSIX EREs, more rarely, Python or Java regexes. Unless someone is reminiscing about their language theory courses in university in which case it's formal regexes all the way. I've never worked in a place where "regex" == "PCRE" unless the actual subject of discussion is Perl programming. In the linux thread especially I'd expect it to be EREs, since those are what are used by grep, sed, less, etc.

So when someone says "EREs are more limited than normal regular expressions", the thought that "normal" here meant "Perl-compatible" never even crossed my mind.

evol262
Nov 30, 2010
#!/usr/bin/perl

SamDabbers posted:

Set up chrooted SFTP instead. It's better in every single way: encrypted, NAT-friendly, and public key authentication, to name a few.

SFTP is not a substitute FTP. There, I said it.

There are a lot of legacy systems which use FTP, even for upload-only. It's an ancient plaintext protocol (SSL is available) which runs at nearly wire speed. SFTP is convenient if you also run SSH, you don't mind telling users they need to use an SFTP client or library which may not exist for their app without rewriting or refactoring part of it, it's limited by per-core encryption throughput, it may require finicky interactions with weird PAM bits or other nonstandard auth databases to talk to Radius or other common auth schemes for FTP, etc.

SFTP is great for a number of reasons. But unless you know why someone's setting up FTP, please stop suggesting it, since it's probably not suitable.

evol262
Nov 30, 2010
#!/usr/bin/perl

ToxicFrog posted:

:shrug: In the places I hang out Perl regular expressions are always "PCREs" and someone just saying "regexes" is referring to either POSIX EREs, more rarely, Python or Java regexes. Unless someone is reminiscing about their language theory courses in university in which case it's formal regexes all the way. I've never worked in a place where "regex" == "PCRE" unless the actual subject of discussion is Perl programming.

Python, Java, PHP, Javascript, Go, Ruby, .NET and every other "regex" you'll find in a modern programming language is also vastly more powerful than extended regexps. People lump a lot of these into PCREs despite them broadly not using libpcre because the syntax used by Python and Java (excessive backslashing notwithstanding) is basically the one pioneered by PCREs, even if the backend is re2 or something else. Someone who knows Python regexps can walk in the door and read them in perl, other than some odd unicode bits you rarely see. The same cannot be said for looking at EREs. Because python regexps are a superset of the functionality offered by EREs.

Big Bowie Bonanza
Dec 30, 2007

please tell me where i can date this cute boy
It's for a college class, so I need to use FTP.

I have passive mode enabled and iptables disabled. I don't know what other NAT firewall it would be running through at this point. When I check port 21 from an external site it says it isn't open but I have vsftpd enabled and listening on that port and nothing should be blocking it.

spankmeister
Jun 15, 2008






FordPRefectLL posted:

It's for a college class, so I need to use FTP.

I have passive mode enabled and iptables disabled. I don't know what other NAT firewall it would be running through at this point. When I check port 21 from an external site it says it isn't open but I have vsftpd enabled and listening on that port and nothing should be blocking it.

is the ip address on the network card on the VM the same as on the internet? if not, you have NAT.

Big Bowie Bonanza
Dec 30, 2007

please tell me where i can date this cute boy
Okay, I understand that better now. Still not sure how to proceed with this, though.

spankmeister
Jun 15, 2008






FordPRefectLL posted:

Okay, I understand that better now. Still not sure how to proceed with this, though.

Maybe it would help if you'd draw a little map on how the VM is connected on through the internet, complete with any virtual or physical network device.

e: And of course don't forget the firewall on the host system.

Odette
Mar 19, 2011

FordPRefectLL posted:

It's for a college class, so I need to use FTP.

I have passive mode enabled and iptables disabled. I don't know what other NAT firewall it would be running through at this point. When I check port 21 from an external site it says it isn't open but I have vsftpd enabled and listening on that port and nothing should be blocking it.

I had an issue with vsftpd and passive mode a while back. Putting this into vsftpd.conf & restarting the service pretty much enabled it:

pasv_enable=YES
pasv_min_port=$minPort
pasv_max_port=$maxPort
pasv_address=$publicServerIP

Big Bowie Bonanza
Dec 30, 2007

please tell me where i can date this cute boy
Hmm, you know what I just realized might be a problem in the middle of making the diagram?

I forgot that I hadn't installed my SB6141 modem yet and I still have Cox's Netgear modem/router combo serving as the modem. I would need to forward the ports from that as well, correct?

Odette
Mar 19, 2011

FordPRefectLL posted:

Hmm, you know what I just realized might be a problem in the middle of making the diagram?

I forgot that I hadn't installed my SB6141 modem yet and I still have Cox's Netgear modem/router combo serving as the modem. I would need to forward the ports from that as well, correct?

ISP provided hardware tends to be really lovely, so most likely. Give that a go and see what happens.

Big Bowie Bonanza
Dec 30, 2007

please tell me where i can date this cute boy
I figure instead of loving with that I may as well install the new modem and do it that way. Time to sit on hold.

Big Bowie Bonanza
Dec 30, 2007

please tell me where i can date this cute boy
Yep, setting up the new modem almost immediately fixed it. Thanks for the help guys.

spankmeister
Jun 15, 2008






FordPRefectLL posted:

Yep, setting up the new modem almost immediately fixed it. Thanks for the help guys.

There you go. See? Once you have a complete picture you can usually instantly figure out where the problem is.

program666
Aug 22, 2013

A giant carnivorous dinosaur
I was thinking about getting a tablet/netbook convertible and install linux in it. How much of a pain will it be? Is there a good list of linux-friendly netbooks?

CaptainSarcastic
Jul 6, 2013



program666 posted:

I was thinking about getting a tablet/netbook convertible and install linux in it. How much of a pain will it be? Is there a good list of linux-friendly netbooks?

I'm not sure, and haven't researched it too much, but I would be concerned about proper touchscreen support. The only touchscreen I have around, aside from my phones, is an HP all-in-one that I run without touchscreen support under openSUSE 13.1. I think the primary reason I haven't been able to get the touchscreen working is that it has an old enough ATI GPU that I can't use the proprietary drivers, although in all honesty I stopped trying to get the touchscreen to work after a relatively short amount of troubleshooting - it just wasn't that high a priority for me.

I run openSUSE 13.1 KDE on my low-powered Acer AO722 netbook and it does nicely, but that doesn't have a touchscreen.

evol262
Nov 30, 2010
#!/usr/bin/perl

CaptainSarcastic posted:

I'm not sure, and haven't researched it too much, but I would be concerned about proper touchscreen support. The only touchscreen I have around, aside from my phones, is an HP all-in-one that I run without touchscreen support under openSUSE 13.1. I think the primary reason I haven't been able to get the touchscreen working is that it has an old enough ATI GPU that I can't use the proprietary drivers, although in all honesty I stopped trying to get the touchscreen to work after a relatively short amount of troubleshooting - it just wasn't that high a priority for me.

I run openSUSE 13.1 KDE on my low-powered Acer AO722 netbook and it does nicely, but that doesn't have a touchscreen.

The touchscreens mostly show up as USB devices which handle input. GPU drivers have nothing to do with it. They should "just work", on a very basic level.

10 point touch and any touchscreen actions (pinch to zoom, etc) pretty much need to wait for Wayland, though.

BlackMK4
Aug 23, 2006

wat.
Megamarm
Is there an easy way to rename files in a directory to the lines in a text file?

File contains something like
001
001a
002

and so on...

Directory contains the same number of files which are named in a way that coincides with the lines in a textfile
2003-sbk999 2.jpeg
2003-sbk999 4.jpeg
2003-sbk999 6.jpeg

etc.

Odette
Mar 19, 2011

I've just been forwarded this abuse notification from my webhost and I have no idea what the gently caress they're talking about. I apparently have less than 24 hours to respond as well.

quote:

Dear Sir or Madam

Simple Service Discovery Protocol (SSDP) is a network protocol which
is used to search for UPnP applicances on the network. SSDP is generally
used over port 1900/udp.

During the past few months, systems which respond to SSDP requests
from the Internet have been increasingly misused for performing DDoS
reflection/amplification attacks.

In the course of the Shadowserver 'Open SSDP Scanning Project', systems
are identified which respond to SSDP requests from the Internet.
These systems may potentially be misused for carrying out DDoS attacks
if no other countermeasures have been implemented.

We are sending you the following list of affected systems in your net
area. The timestamp shows when the system was checked and when it
responded to an SSDP request from the Internet.

We kindly request that you examine the situation and take measures to
safeguard SSDP services on the systems concerned and inform your customers
accordingly.

A list of the affected systems in your net area:

Format: ASN | IP Address | Timestamp (UTC) | SSDP Server
24940 | $serverIP | 2014-11-13 10:31:37 | Linux/3.13.0-39-generic UPnP/1.0 Cling/2.0


After some googling, I've found this:

http://forum.subsonic.org/forum/viewtopic.php?f=2&t=14873

spankmeister
Jun 15, 2008






Firewall your poo poo.

Basically your server can be used for reflective DDoS attacks where the attacker spoofs the source address of the request into the ip of the DDoS victim. Because SSDP is a udp service this works.


There are several protocols that can be used for this like DNS, NTP and in your case SSDP.

I am not a book
Mar 9, 2013
What's the status of usb-serial adapters these days? Is there anything that's automatically supported(Ubuntu 14.10) or am I going to have to dig through dmesg to set it up?

I am not a book fucked around with this message at 21:47 on Nov 19, 2014

spankmeister
Jun 15, 2008






I am not a book posted:

What's the status of usb-serial adapters these days? Is there anything that's automatically supported(Ubuntu 10.14) or am I going to have to dig through dmesg to set it up?

Most are based on PL2303 chips which are supported out of the box. You'll just end up with /dev/ttyUSB0 after plugging it in.

I am not a book
Mar 9, 2013

spankmeister posted:

Most are based on PL2303 chips which are supported out of the box. You'll just end up with /dev/ttyUSB0 after plugging it in.

Thank you.
I'm open to suggestions for anything that anyone's had a particularly good experience with.

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass

I am not a book posted:

What's the status of usb-serial adapters these days? Is there anything that's automatically supported(Ubuntu 10.14) or am I going to have to dig through dmesg to set it up?

FTDI adapters work out of the box on 12.04 and 14.04 for me. No idea about 10.14.

I am not a book
Mar 9, 2013

mod sassinator posted:

FTDI adapters work out of the box on 12.04 and 14.04 for me. No idea about 10.14.

That was my bad, I meant 14.10.

telcoM
Mar 21, 2009
Fallen Rib

BlackMK4 posted:

Is there an easy way to rename files in a directory to the lines in a text file?

File contains something like
[...]

Directory contains the same number of files which are named in a way that coincides with the lines in a textfile
[...]

There are many easy ways, but you'll need to be able to describe your requirements exactly.

From your example, the coincidence is not exactly obvious. Are the lines in the text file ordered to exactly match the files in the directory, or should the line in the file be matched with some part of the filename?

In other words, using your example, did you want the renaming to happen exactly like this?
(Because your filenames contain spaces, they must be quoted. I'm not sure about the lines in your text file, so I will quote them too, just in case.)

code:
mv -i "2003-sbk999 2.jpeg" "001"
mv -i "2003-sbk999 4.jpeg" "001a"
mv -i "2003-sbk999 6.jpeg" "002"
This output would be produced by this script:
code:
#!/bin/sh

for filename in *
do
    read textline
    echo "mv -i \"$filename\" \"$textline\""
done
This script should be run like this:
code:
$ cd /some/where/directory_with_the_files_to_rename
$ sh /else/where/script.sh  < /else/where/file_with_lines.txt
Or do you perhaps want to keep the .jpeg suffix?

My example will only work if all the names of your files to be renamed will fit on a single command line, i.e. if the command "ls *" in that directory will run without a "command line too long" error message. If the number of files is larger than that, a different approach will be needed.

As is, my script will only produce a list of mv commands. If it is mostly correct, you could pipe the output into a file, edit it to fix the mistakes, and then run the result as another script.

Or if it is entirely correct, you could, after verifying the output for correctness, remove the "echo" command, the outermost double quotes and the 4 backslashes from the 'echo "mv -i ..."' line and then run the script again.

mod sassinator
Dec 13, 2006
I came here to Kick Ass and Chew Bubblegum,
and I'm All out of Ass

I am not a book posted:

That was my bad, I meant 14.10.

Ah, yeah pick up an FTDI or PL2303 adapter and it should just show up as /dev/ttyUSB0.

Odette
Mar 19, 2011

spankmeister posted:

Firewall your poo poo.

Basically your server can be used for reflective DDoS attacks where the attacker spoofs the source address of the request into the ip of the DDoS victim. Because SSDP is a udp service this works.


There are several protocols that can be used for this like DNS, NTP and in your case SSDP.

My iptables config only allows TCP for the following http/https/ssh/mail/ping/torrent, and the rest is dropped. I don't have any UDP rules, except for ping/torrent.

How can you uninstall or disable SSDP? I can't find any info online.

spankmeister
Jun 15, 2008






Odette posted:

My iptables config only allows TCP for the following http/https/ssh/mail/ping/torrent, and the rest is dropped. I don't have any UDP rules, except for ping/torrent.

How can you uninstall or disable SSDP? I can't find any info online.

That's interesting. Looks like you're running some kind of UPnP service by the UPnP/1.0 Cling/2.0 identifier.

Odette
Mar 19, 2011

spankmeister posted:

That's interesting. Looks like you're running some kind of UPnP service by the UPnP/1.0 Cling/2.0 identifier.

Yeah, I had a look at my logs and I didn't setup iptables until after the SSDP scan was performed. That could be why, but I still have no idea what the UPnP service could be.

The only UPnP service I can think of is Subsonic, but I've disabled all UPnP options in the GUI interface.

Liam Emsa
Aug 21, 2014

Oh, god. I think I'm falling.
I have Ubuntu 14.04 LTS installed on a Lenovo touchscreen laptop. The touchscreen works, however gestures don't. I.e. I can't scroll down by swiping down on the screen, but I can select items by tapping the screen. Is there a way to fix this?

evol262
Nov 30, 2010
#!/usr/bin/perl

Liam Emsa posted:

I have Ubuntu 14.04 LTS installed on a Lenovo touchscreen laptop. The touchscreen works, however gestures don't. I.e. I can't scroll down by swiping down on the screen, but I can select items by tapping the screen. Is there a way to fix this?

Wayland/mir. I hear Ubuntu Touch has a little support, but X just isn't built for those actions at present. It's one of many reasons why a successor is needed

fuf
Sep 12, 2004

haha
Can you guys give me some pointers on monitoring bandwidth usage? I have nginx, plex and rtorrent running on the same server and I want to keep track of how much bandwidth each has used over given periods. Is there something simple that just writes daily totals to a file or something?

BlackMK4
Aug 23, 2006

wat.
Megamarm

telcoM posted:

There are many easy ways, but you'll need to be able to describe your requirements exactly.

From your example, the coincidence is not exactly obvious. Are the lines in the text file ordered to exactly match the files in the directory, or should the line in the file be matched with some part of the filename?

In other words, using your example, did you want the renaming to happen exactly like this?
(Because your filenames contain spaces, they must be quoted. I'm not sure about the lines in your text file, so I will quote them too, just in case.)

code:
mv -i "2003-sbk999 2.jpeg" "001"
mv -i "2003-sbk999 4.jpeg" "001a"
mv -i "2003-sbk999 6.jpeg" "002"
This output would be produced by this script:
code:
#!/bin/sh

for filename in *
do
    read textline
    echo "mv -i \"$filename\" \"$textline\""
done
This script should be run like this:
code:
$ cd /some/where/directory_with_the_files_to_rename
$ sh /else/where/script.sh  < /else/where/file_with_lines.txt
Or do you perhaps want to keep the .jpeg suffix?

My example will only work if all the names of your files to be renamed will fit on a single command line, i.e. if the command "ls *" in that directory will run without a "command line too long" error message. If the number of files is larger than that, a different approach will be needed.

As is, my script will only produce a list of mv commands. If it is mostly correct, you could pipe the output into a file, edit it to fix the mistakes, and then run the result as another script.

Or if it is entirely correct, you could, after verifying the output for correctness, remove the "echo" command, the outermost double quotes and the 4 backslashes from the 'echo "mv -i ..."' line and then run the script again.

That shall work. Thank you very much. :) I should figure out how shell scripting works since it seems it will be very useful to me.

JHVH-1
Jun 28, 2002

fuf posted:

Can you guys give me some pointers on monitoring bandwidth usage? I have nginx, plex and rtorrent running on the same server and I want to keep track of how much bandwidth each has used over given periods. Is there something simple that just writes daily totals to a file or something?

When I was working for a web host, we had a customer that kinda wanted this info and the best thing that got close to what he wanted at the time was http://bandwidthd.sourceforge.net

By default it doesn't even save the stats to disk. It also hasn't been updated since 2005, but it may still work OK.

Varkk
Apr 17, 2004

fuf posted:

Can you guys give me some pointers on monitoring bandwidth usage? I have nginx, plex and rtorrent running on the same server and I want to keep track of how much bandwidth each has used over given periods. Is there something simple that just writes daily totals to a file or something?

Nethogs may be able to do what you want.

program666
Aug 22, 2013

A giant carnivorous dinosaur

evol262 posted:

10 point touch and any touchscreen actions (pinch to zoom, etc) pretty much need to wait for Wayland, though.
Oh that's kind of bad but I guess it's acceptable. Thanks for the responses guys.

Adbot
ADBOT LOVES YOU

Ashex
Jun 25, 2007

These pipes are cleeeean!!!
My media server has been running Archlinux for the last 6 years and has worked really for me, unfortunately I made the fatal error of going with f2fs when I upgraded to an SSD and after a power outage. I've now got some intense disk corruption I'm recovering from so it's looking like I'll need to do a fresh install leaving me with two choices:

  • Reinstall Archlinux and copy over database/config files
  • Change distro and copy over database/config files

The main reason I've stuck with archlinux so long is because of AUR/ABS, the ability to custom build anything and easily turn it into a package has spoiled me. Is there another distro I should consider? I'm familiar with SPEC files so something rpm based wouldn't be scary.

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