HELP! I want to create a local host but when i use http://localhost:${process.env.PORT} it creates a local host with undefined location which is not recognisable by postman,how can i change it to Localhost 3000
I tired running the command
Related
I am trying to connect locally installed steampipe to my local postgresql database container which is running on port 5432. So that i can see the output of my sql queries will be stored on my personal postgresql database. I don't want to use steampipe's own database.
I have taken have taken the following steps:
I ran on my wsl ubuntu terminal:
export STEAMPIPE_WORKSPACE_DATABASE=postgresql://postgresUser:postgresPW#localhost:5432/postgresDB --> reference to https://steampipe.io/docs/reference/env-vars/steampipe_workspace_database
I checked the configurations inside steampipe.
Made the change inside ~/.steampipe/config/default.spc
options "database" {
port = 5432 # any valid, open port number
listen = "local" # local, network
#search_path = "" # comma-separated string
}
I added the line inside ~/.steampipe/db/14.2.0 /data/postgresql.conf
listen_addresses = '*'
I added the line inside ~/.steampipe/db/14.2.0/data/pg_hba.conf
host all all 0.0.0.0/0
Still i am unable to connect steampipe to my local postgresql database container which is running on port 5432
On executing: steampipe service start, I am getting below result
Error: cannot listen on port 5432
I have a project and I need to use 2 port numbers.
Currently, I am working on localhost:3000 and now I need to use another port number.
Does anyone know how to do this?
Use the following using the port number that you want to use.
rails s -p 3001 -b 0.0.0.1
I am trying to execute the container named redis which is running right now.But the error Could not connect to Redis at redis:6379: Name or service not known. Any one please hell me to figure out the issue and fix it.
This is because both the containers are not in same network, Add a network property inside service name and make sure its same for both
redis:
networks:
- redis-net
Naming the container doesn't alter your hosts file or DNS, and depending on how you ran the container it may not be accessible via the standard port as Docker does port translation.
Run docker inspect redis and examine the ports output, it will tell you what port it is accessible on as well as the IP. Note, however, that this will only be connectable over that IP from that host. To access it from off of the host you will need to use the port from the above command and the host's IP address. That assumes your local firewall rules allow it, which are beyond the scope of this site.
Try below command
src/redis-cli -h localhost -p 6379
I connect to two different SSH servers A and B using PuTTY+Xming from Windows.
On server A, echo $DISPLAY yields localhost:10.0 (already set somehow); while on server B, I've manually set the DISPLAY variable to be localhost:10.0 as well.
However, I am able to use xclock on server A, but not on server B. The only way I could get it to work on server B is by adding server B's IP address to Xming's X0.hosts configuration AND setting the DISPLAY environment variable to my Windows machine's IP address.
My question is, how come server A's xclock works with minimal setup (just enable X11 forwarding and set display location to localhost:0.0 in PuTTY), but not server B's?
In addition, how can one look for the script that set the DISPLAY environment variable to localhost:10.0 on server A?
Additional info:
1) Server A has an ~/.Xauthority file that gets automatically created upon login, while server B does not.
2) Server B's /var/log/auth.log contained the following error: sshd[1404]: error: Failed to allocate internet-domain X11 display socket.
3) I changed the hostname of Server B once before.
After much googling, it turns out the culprit is disabled ipv6 on server B.
As a workaround, the following line needs to be added to /etc/ssh/sshd_config:
AddressFamily inet
Should now work after sudo service ssh reload.
I found the solution here and here.
Can i block an IP address in apache module?
i searched it, but it comes up with no answer, is it true?
You can block using iptables. with a simple rule.
But if you have concerns over some ip address causing DOS attacks or something then you can add it to your black list automatically by using DOS deflate program. I am providing it below for your convenience.
This script will help protect dos attack on our servers. We will use DDos deflate method.
This method will use iptables to block any dos traffic. and will create a cronjob that will execute every minute to execute the script, script will then monitor any threats and stops them using iptables.
1. Install the deflate script
wget http://www.mattzuba.com/wordpress/wp-content/uploads/2011/02/ddos_deflate-0.7.tar.gz
tar -xf ddos_deflate-0.7.tar.gz
cd ddos_deflate-0.7
sudo ./install.sh
2. now the above script is installed in the directory /usr/local/ddos
cd /usr/local/ddos
you will see a file called ddos.conf, edit the file
vi ddos.conf
Here you will see various options, look for ##### How many connections define a bad IP? Indicate that below.
NO_OF_CONNECTIONS=xyz
change no of connections to 200
NO_OF_CONNECTIONS=200
Where 200 is the number of total connections allowed by an ip address in one second. The number can be increased or decreased as per need. Connections over the defined number will be considered a dos attack.
3. setting ip address block time
cd /usr/local/ddos
you will see a file called ddos.conf, edit the file
vi ddos.conf
and look for ##### Number of seconds the banned ip should remain in blacklist.
BAN_PERIOD=60
change ban period to
BAN_PERIOD=600
Where 600 is the number of seconds the ip address will be blocked for, after that it will be released. This nmber can be changed as per need.
4. allow selected ip address to access the system without getting banned or restrictions.
cd /usr/local/ddos
you will see a file called ignore.ip.list, edit the file
vi ignore.ip.list
enter the following ip address to be unblocked
127.0.0.1 ----> the localhost ip address
92.235.247.186 ----> public ip address of the server (change as required)
Hope this helps a little.