Snap Proxy doesn´t work - proxy

I try to install Conjure-Up on my Ubuntu 18.04 virtual machine with
$sudo snap install conjure-up --classic
But it always says:
error: cannot install "conjure-up": Post https://api.snapcraft.io/v2/snaps/refresh: proxyconnect
tcp: EOF
I have successfully set up my http and https proxy in /etc/environments
need help.

It will help.
Example
sudo snap set system proxy.http=http://127.0.0.1:3128
sudo snap set system proxy.https=http://127.0.0.1:3128

Looks like snapd doesn't apply the /etc/environment proxy settings as of 18.04. You can apply an override to snapd service to get around this though.
sudo systemctl edit snapd.service
Add in the following:
[Service]
Environment=http_proxy=http://proxy:port
Environment=https_proxy=http://proxy:port
Save then reload:
sudo systemctl daemon-reload
sudo systemctl restart snapd.service
Snap installs should now go through specified proxy.

try this:
sudo snap set system proxy.http=socks5://127.0.0.1:1080
sudo snap set system proxy.https=socks5://127.0.0.1:1080
then you see the download speed is much faster:
47% 2.19MB/s 7.37s

Related

Clean reinstall and fix of httpd service error on macos

I'm still having some problems on using httpd (aka Apache2) after the update of my MacOs on BigSur.
I tried to make a clean reinstall of apache2 using the brew httpd services (like said in a lot of tutorials) but it still not working. I make a summary of the steps taked and I'll add some debug command.
To reinstall I done:
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew install httpd
After that I reboot and launched the command:
brew services start httpd
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
But if I run the following command:
brew services list
Name Status User Plist
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
fuseki stopped
httpd error matteo.ceradini /Users/matteo.ceradini/Library/LaunchAgents/homebrew.mxcl.httpd.plist
mongodb-community started matteo.ceradini /Users/matteo.ceradini/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
unbound stopped
As you can see the httpd is in an error status (in fact going to localhost:8080 I get an error) and I can't understand why.
Any suggestion how to fix this?
Thank you.
Something seems to not working, but still I can't find why.
I stopped all the services (either sudo brew and brew without sudo), and next running the commands:
sudo lsof -i :80
sudo lsof -i :8080
sudo lsof -i tcp:80
sudo lsof -i tcp:8080
the results is always nothing. But if I run:
sudo brew services start httpd
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
The httpd will not start (even if in the terminal command it says yes):
sudo brew services list
httpd error root /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
And if I check the apachetl error I get always that the port 80 is occupied, even if there isn't processes on that port:
apachectl -e error
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
I urgently need to find a solution for this bug. It seems that in some httpd is corrupted, even if I uninstall and reinstall again
UPDATE:
I really don't know how I did it, but now it's working. I stopped all the brew httpd services and I restard apache using the command:
sudo apachectl -k start
and that worked for me
I just had exactly the same issue on Monterey. As digging in, it seems that the problem was a symbol not found ( _apr_bucket_alloc_aligned_floor ), expected in: /usr/lib/libaprutil-1.0.dylib.
Reinstalling apr-util fixed my case:
brew reinstall apr-util
FIRST ANSWER:
Sounds like the service started OK then later (or immediately) died, and reports an error. Using the command 'apachectl -e error' should provide details, but you'd wanna check the logs ('vi /usr/local/var/log/httpd/error_log', then shift-G [to goto end]).
SECOND (EXPLAINATION) ANSWER:
"
If you use (sudo) brew services ... to start httpd you have to use the proper (sudo) brew services list command to check the status:
If you start it as root then list it with root privs:
sudo brew services start httpd > sudo brew services list
or with user privs:
brew services start httpd > brew services list.
"
Judging by the result from sudo apachectl -e error, it cannot use port 8080 because another app is using it.
The first warning - can be ignored - or set the FQDN in httpd.conf. Usually this is in the '/usr/local/etc/httpd' folder. Edit with sudo vi /usr/local/etc/httpd/httpd.conf. (I like vi - use whatever you feel comfortable with - sudo open -e /usr/local/etc/httpd/httpd.conf is common).
The default config has the line #ServerName www.example.com:8080, remove that '#' and replace 'www.example.com:8080' with 'MBP-Matteo.local' - or whatever.
Type sudo lsof -i tcp:8080 to list all apps using port 8080, mostly only apps that LISTEN are important.
Next error: You must stop that other app which is using port 8080 (and prevent starting on boot) - or - set Apache to use a different port. (Note: If you choose a port lower than 1024, 'sudo' must be used to start the service.) Usually port 80 is devoted to Apache. The port to be used can be set by editing the config file, as above, then find the line 'Listen 8080', and replace 8080 with the desired port.
After the changes, try to start again with [sudo] 'brew services start httpd'. Then check with [sudo] 'brew services list'. Hopefully all works fine.
FIRST ANSWER: Sounds like the service started OK then later (or immediately) died, and reports an error. Using the command 'apachectl -e error' should provide details, but you'd wanna check the logs ('vi /usr/local/var/log/httpd/error_log', then shift-G [to goto end]).
The first command gives this result:
sudo apachectl -e error
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using MBP-Matteo.local. Set the 'ServerName' directive globally to suppress this message
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
AH00015: Unable to open logs
And the file '/usr/local/var/log/httpd/error_log' is empty
SECOND (EXPLAINATION) ANSWER: " If you use (sudo) brew services ... to start httpd you have to use the proper (sudo) brew services list command to check the status:
The results doesn't change if I executed brew commands with both sudo or without (given that previously I was using without sudo)
Any suggestions?
my solution, stop httpd service, then check httpd.conf and check DocumentRoot "/opt/homebrew/var/www"
<Directory "/opt/homebrew/var/www"> when returning to the original state this route, restart the httpd service and it worked without problems.
A simple brew reinstall httpd fixed it for me. All .conf files remained intact after reinstall for anyone wondering.

Failed to restart supervisor.service: Unit not found CentOS 7

I am trying to use laravel queue:work on live server and keep alive the work using Supervisor. After configuration it shows as follows:
[root#vmi485931 supervisord.d]# sudo supervisorctl reload
Restarted supervisord
[root#vmi485931 supervisord.d]# sudo service supervisor restart
Redirecting to /bin/systemctl restart supervisor.service
Failed to restart supervisor.service: Unit not found.
Any clue?
there are some package missing in Centos 7. i had some issue on centos 7 and i fixed issue with this commands :
1- need python-meld3 package
sudo rpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/python-meld3-0.6.10-1.el7.x86_64.rpm
2-needs supervisor lib.
sudo rpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/s/supervisor-3.4.0-1.el7.noarch.rpm
If you are trying to restart the processes that are run by supervisor, run
sudo supervisorctl restart all
You can use supervisor process name instead of 'all' to restart a specific process.
If you are trying to restart supervisor itself,sudo systemctl restart supervisor should work.

Can't start ceph service

I working on CentOS7 and I install ceph by manual build
./autogen.sh
./configure
make
make install
and manual deploy by follow this link http://ceph.com/docs/master/install/manual-deployment/
but ceph doesn't exist in directory /etc/rc.d/init.d/
Failed to issue method call: Unit ceph.service failed to load: No such
file or directory
So, I can't start service.
In document of manual deploy it's said I have to use command
sudo /etc/rc.d/init.d/ceph start mon.node1
In CentOS7 use systemd
So, use command sudo systemctl start ceph-osd#0 will work!!!
You can run systemctl status ceph* as a quick way to show any services on the box or systemctl list-units --type=service | grep ceph the service name syntax is ceph-mon#<hostname>.service or ceph-osd#<osd_num>.service
Please run systemctl list-unit-files and you can list all ceph services and you must find OSD number with ceph osd tree and put in this command systemctl status ceph-osd#{OSD_NUM}.target

How to shut down rethinkdb running on Mac OSX

Note: We love RethinkDB but our current project does not use it so we need to free up resources on our local machine ...
We installed RethinkDB using homebrew:
brew update && brew install rethinkdb
And added the rethinkdb process to our plist as per the instructions in:
http://rethinkdb.com/docs/start-on-startup/
But now we need to shut it down to free-up the 8080 port for another service.
What command do we need to run? (thanks!)
Do this in the terminal
check to see if you started it using brew
$ brew services list
stop rethinkdb:
$ brew services stop rethinkdb
restart:
$ brew services start rethinkdb
Like this, I think, if you used launchctl:
sudo launchctl unload -w /Library/LaunchDaemons/com.rethinkdb.server.plist

Clamav installation steps for linux centos

I have tried to install clamav in linux centos, but not able to succeed, so anybody provide me the procedure to install clamav antivirus and test the same.
Thanks in advance
First thing to do is install the program sudo apt-get install clamav
It´s necessary install the deamon program as well sudo apt-get install clamav-daemon
Once that we have the program properly installed, will be necessary configure to make it works with our app. /etc/clamav/clamd.conf
TCPAddr 127.0.0.1
TCPSocket 3310
To configure by console the antivirus just type sudo dpkg-reconfigure clamav-freshclam
Restart the service sudo /etc/init.d/clamv-* restart
For CentOS 6
Install ClamAV via yum epel repo:
yum install clamd
Edit config file:
vim /etc/clamd.conf
ExtendedDetectionInfo yes
ExcludePath /usr/local/maldetect/
DetectPUA yes
Set to start on boot:
chkconfig clamd on
Update ClamAV prior to a scan:
freshclam
Start ClamAV:
service clamd start
Add the cron for daily automatic scans:
vim /etc/cron.daily/daily-clamscan
#!/bin/bash
SCAN_DIR="/"
LOG_FILE="/var/log/clamav/daily-clamscan.log"
/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILE
Set proper cron permissions:
sudo chmod +x /etc/cron.daily/daily-clamscan
Update the logrotate file to look for all logs via wildcard
vim /etc/logrotate.d/daily-clamscan
/var/log/clamav/daily-clamscan.log {
missingok
notifempty
create 644 clam clam
}
Thats how I installed it on my machine. Here are a few good quick commands or you can use the cron to manually run it. I also installed Linux Malware Detect (LMD) with it so I can do more for my scans.
Full System Scan that only displays infected files and runs in the background with bell
Use jobs command to view status
clamscan -r --bell -i / &

Resources