How to SSH login without password?
You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.
First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:
Now use ssh to create a directory
Finally append a's new public key to
From now on you can log into B as b from A as a without password:
#linux #sysadmin #ssh #password_less #ssh_login
You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.
How to do it?
First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
Now use ssh to create a directory
~/.ssh
as user b on B. (The directory may already exist, which is fine):a@A:~> ssh b@B mkdir -p .ssh
b@B's password:
Finally append a's new public key to
b@B:.ssh/authorized_keys
and enter b's password one last time:a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:
From now on you can log into B as b from A as a without password:
a@A:~> ssh b@B
#linux #sysadmin #ssh #password_less #ssh_login
Virt-builder
is a tool for quickly building new virtual machines. You can build a variety of VMs for local or cloud use, usually within a few minutes or less. Virt-builder
also has many ways to customize these VMs. Everything is run from the command line and nothing requires root privileges, so automation and scripting is simple.To see available virtual machines:
virt-builder --list
Sample command to create a
debian-9
image:sudo virt-builder debian-9 --size=50G --hostname prod.example.com --network --install network-manager --root-password password:YOUR_PASS
The above command creates a debian 9 image with disk size of 50GB and sets the hostname to
prod.example.com
. --network
enables the networking on guest and --install
installs packages on the target OS. The last parameter sets the root password to
YOUR_PASS
.To read more about the axtra parameters:
- http://libguestfs.org/virt-builder.1.html
#linux #sysadmin #virt_builder #debian #image
You can login to a server without entering a password by a simple command as below:
By issuing the above command it puts your public key content on server
#linux #sysadmin #ssh #passwordless_login #ssh_copy_id #authorized_keys #public_key
ssh-copy-id USERNAME@YOUR_HOST_IP -p 22
By issuing the above command it puts your public key content on server
~/.ssh/authorized_keys
and prompts you to enter the password. You are all done by this.#linux #sysadmin #ssh #passwordless_login #ssh_copy_id #authorized_keys #public_key
How I store & manage passwords in Linux for servers and other credentials? gopass
Password management should be simple and follow Unix philosophy. With
- https://github.com/gopasspw/gopass
#unix #linux #sysadmin #pass #gopass #password_management #golang #github
Password management should be simple and follow Unix philosophy. With
pass
, each secret lives inside of a gpg
encrypted file whose filename is the title of the website or resource that requires the secret. These encrypted files may be organized into meaningful folder hierarchies, copied from computer to computer, and, in general, manipulated using standard command line file management utilities. gopass
is a rewrite of the pass
password manager in Go
with the aim of making it cross-platform and adding additional features. Our target audience are professional developers and sysadmins
(and especially teams of those) who are well versed with a command line interface. One explicit goal for this project is to make it more approachable to non-technical users. We go by the UNIX philosophy and try to do one thing and do it well, providing a stellar user experience and a sane, simple interface:- https://github.com/gopasspw/gopass
#unix #linux #sysadmin #pass #gopass #password_management #golang #github
GitHub
GitHub - gopasspw/gopass at opensourceprojects.dev
The slightly more awesome standard unix password manager for teams - GitHub - gopasspw/gopass at opensourceprojects.dev
Do you need a full-featured open source mail server?
Read more about it on github page:
- https://github.com/atech/postal
#github #mailserver #mail #mailgun #sendgrid #postmark #postal #open_source
Postal
is a complete and fully featured mail server for use by websites & web servers. Think Sendgrid
, Mailgun
or Postmark
but open source and ready for you to run on your own servers. Postal
was developed by aTech Media
to serve its own mail processing requirements and we have since decided that it should be released as an open source project for the community.Read more about it on github page:
- https://github.com/atech/postal
#github #mailserver #mail #mailgun #sendgrid #postmark #postal #open_source
GitHub
GitHub - postalserver/postal: 📮 A fully featured open source mail delivery platform for incoming & outgoing e-mail
📮 A fully featured open source mail delivery platform for incoming & outgoing e-mail - postalserver/postal
How a programmer download from Spotify? (In case you cannot purchase the song and download them from IR like me)
In order to download a song copy the music link and:
Or in case you have a playlist link:
To read installation and more command options:
- https://github.com/ritiek/spotify-downloader
#python3 #spotdl #spotify #github
spotdl
is one of the great number one python 3 packages that downloads a song or playlist on your system.In order to download a song copy the music link and:
spotdl --song https://open.spotify.com/track/2DGa7iaidT5s0qnINlwMjJ
Or in case you have a playlist link:
$ spotdl --playlist https://open.spotify.com/user/nocopyrightsounds/playlist/7sZbq8QGyMnhKPcLJvCUFD
INFO: Writing 62 tracks to ncs-releases.txt
$ spotdl --list ncs-releases.txt
To read installation and more command options:
- https://github.com/ritiek/spotify-downloader
#python3 #spotdl #spotify #github
GitHub
GitHub - ritiek/spotify-downloader: Download your Spotify playlists and songs along with album art and metadata (from YouTube if…
Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found). - ritiek/spotify-downloader
Visual Studio Live Share
Real-time collaborative development can be done using live share plugin. Coders can work simultanously o nthe same file without an interruption:
- https://visualstudio.microsoft.com/services/live-share/
#IDE #microsoft #liveshare #plugin #visualstudio
Visual Studio
Live Share: Real-Time Code Collaboration & Pair Programming
Real-time collaborative code editor for pair programming, code reviews, technical interviews and more.
One of the methods to document your API is
To read more about the
- http://apidocjs.com/
#javascript #js #python #apidoc #apidocjs #api #documentation #rest #annotation
APIDOC
. It uses annotation in variety of languages like Python
, PHP
, JS
, etc. At the below code block you can see an example in Python
:"""
@api {get} /user/:id Request User information
@apiName GetUser
@apiGroup User
@apiParam {Number} id Users unique ID.
@apiSuccess {String} firstname Firstname of the User.
@apiSuccess {String} lastname Lastname of the User.
"""
To read more about the
APIDOC
itself and the installation process head over to link below:- http://apidocjs.com/
#javascript #js #python #apidoc #apidocjs #api #documentation #rest #annotation
https://superuser.com/questions/453988/whats-the-difference-between-su-with-and-without-hyphen
#linux #su
#linux #su
Super User
What's the difference between "su" with and without hyphen?
I'm quite new to Linux terminal and I'm not quite sure what the difference between su with a hyphen and su without a hyphen is, for example: su - username vs. su username.
I looked into the documen...
I looked into the documen...
Bamilo has reached its end!
The ecommerce website
- https://www.bamilo.com/
#bamilo #digikala #failure #ecommerce #snapp
The ecommerce website
Bamilo
which tried hard to combat with Digikala
has closed down. The domain now redirects to snapp market
:- https://www.bamilo.com/
#bamilo #digikala #failure #ecommerce #snapp
DO NOT USE UWSGI multi-threaded mode with alpine image!
I've been stuck on this issue for a couple of days as our service returned 503 Gateway timeout while our server load was totally ok around 1.0 (1m load average). So our load test got failed at the be beginning of the test! We found out it is related to docker base image of python alpine. Use python slim image instead. Or in case you have many changes you can stick with alpine and change thread to 1 in uswgi configuration file.
#docker #alpine #uwsgi #python #slim #respawn
I've been stuck on this issue for a couple of days as our service returned 503 Gateway timeout while our server load was totally ok around 1.0 (1m load average). So our load test got failed at the be beginning of the test! We found out it is related to docker base image of python alpine. Use python slim image instead. Or in case you have many changes you can stick with alpine and change thread to 1 in uswgi configuration file.
#docker #alpine #uwsgi #python #slim #respawn
A screamingly fast Python 2/3 WSGI server written in C.
https://github.com/jonashaag/bjoern
#wsgi #python2 #python3
https://github.com/jonashaag/bjoern
#wsgi #python2 #python3
GitHub
GitHub - jonashaag/bjoern: A screamingly fast Python 2/3 WSGI server written in C.
A screamingly fast Python 2/3 WSGI server written in C. - jonashaag/bjoern
Do you log a lot like me in your
You can see that both have the same log content but it's hard to follow
The formatter is as below:
Now the output will something like below:
You can see that log content is so much easier to follow by using space padding. It may not be obvious on telegram with small devices. So try it your self :)))
#python #logging #log #logger #formatter #log_formatter #space_padding #padding
Python
modules? If so, you had the same problem to always find the first occurence of a log after time, filename, etc. Let's clarify this with a sample log:[2012-10-02 application.py:1 _get()] DEBUG: this is a log content
[2012-10-02 db.py:1005 _fetch_all_info()] INFO: this is a log content
You can see that both have the same log content but it's hard to follow
cause of length of file name, line number and function name. To format this better we can have space padding in formatters. spaces are identified by `s
. Now lets see the same log, but this time with space padding.The formatter is as below:
[%(asctime)s %(filename)15s:%(lineno)4s %(funcName)20s()] %(levelname)s %(message)s
NOTE: this is not the exact formatter for the above log, it is for demonstration!
Now the output will something like below:
[2012-10-02 application.py: 1 _get()] DEBUG: this is a log content
[2012-10-02 db.py: 1005 _fetch_all_info()] DEBUG: this is a log content
You can see that log content is so much easier to follow by using space padding. It may not be obvious on telegram with small devices. So try it your self :)))
#python #logging #log #logger #formatter #log_formatter #space_padding #padding
How does kubernetes scheduler work?
uling works in Kubernetes.
https://jvns.ca/blog/2017/07/27/how-does-the-kubernetes-scheduler-work/
#containerization #kubernetes #scheduler #pods #kubectl
Stripe
engineer Julia Evans
has written a delightfully clear explanation of how sched‐uling works in Kubernetes.
https://jvns.ca/blog/2017/07/27/how-does-the-kubernetes-scheduler-work/
#containerization #kubernetes #scheduler #pods #kubectl
Julia Evans
How does the Kubernetes scheduler work?
Hello! We talked about Kubernetes’ overall architecture a while back.