I’ve recently switched from using MySQL to PostgreSQL for my Ruby projects. You can connect to a PostgreSQL database from Ruby using the pg gem, but if the pg_config program isn’t in your path you’ll run into problems during installation.
1 2 3 4 5 6 7 8 9
$ sudo gem install pg Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install pg extconf.rb:1: command not found: pg_config --version ERROR: can't find pg_config. HINT: Make sure pg_config is in your PATH ...
A few minutes later I realised I’d installed my copy of PostgreSQL using the one click installer, which puts the database server in the /Library/PostgreSQL directory. This sorted it:
when you install macos server then httpd server will auto run at system boot then 80 and 443 port will used, you can’t run othen http server how to turn off or start apple httpd server command bellow
Same as it is with wget aria2 also offers one argument command line download. Lets try download such us:
1
$ aria2c ftp://local1/linux-distro.iso
If disconnected, you may resume download with the same command. Aria2 keeps a log file of the download progress and will reopen it when download resume is required.
Download from more sources
To speed up your download you can supply aria2 with more than one source of the same file:
In this case aria2 will recognize that the file to be downloaded is same and will split the file into two parts as well as split the download to fetch from two sources and thus utilizing your download bandwidth to the maximum. In case you have provided two different files aria2 will download them both.
Torrent download
Downloading data using torrents is simple as downloading data via http or ftp. If you alredy have a torrent file which you want to use to fetch your data, simply suppy it to aria2 as a command line argument:
1
$ aria2c linux-dist.torrent
With aria2 you do not even have to bother to download torrent file itself, instead simply supply torrent URL:
1
$ aria2c http://local/linux-dist.torrent
In this case aria2 will download the torrent file to your download directory and then start downloading data. If you do not wish aria2 to download a torrent file simplyt use –follow-torrent=mem option :
In this case the actual torrent file will be stored into a memory only, and discarded when download is finished.
Download using metalink
Metalink is a file which contains all possible sources for data to be downloaded. Which means that instead supplying aria2 with a multiple sources we need to supply just a single metalink URL or metalink file. For example, you can download Ubuntu TLS Linux ISO using metalink:
As you may have already guessed the syntax to download via torrent magnets is the same as it was in previous examples. All what needs to be done is to supply aria2 with a magnet link:
If you find yourself using same aria2 options all over again, to save your time you may create a configuration file and list all aria2 options you wish to supply on the command line. To do that open or create aria2 configuration file ~/.aria2/aria2.conf andadd:
this means forwarding our local port 9000 to imgur.com:80
remote port to local port
1 2
ssh -R 9000:localhost:3000 user@example.com
this means forwarding example.com server port 9000 to local 3000 port
By default, OpenSSH only allows connecting to remote forwarded ports from the server host. However, the GatewayPorts option in the server configuration file sshd_config can be used to control this. The following alternatives are possible:
1 2 3 4
sudo vim /etc/ssh/sshd_config GatewayPorts yes sudo service sshd restart
This allows anyone to connect to the forwarded ports. If the server is on the public Internet, anyone on the Internet can connect to the port.