Skip to main content

Posts

Showing posts with the label remote

PostgreSQL DB with pgAdmin4 access through SSH tunnel

Despite using console most of the time I have a preference to edit PostgreSQL databases through UI. Especially when it comes to remote side. Usually one can access this through  $ psql  command. However this tends to writing raw SQL queries and a lot of typing in overall. Here is a way to do it with UI. First one needs to make a tunnel.Command is fairly simple: ssh - fNg - L 5555 : localhost : 5432 { username } @ { host . com } One has a tunnel afterwards. This command opens a SSH connection in the background mapping your local port 5555 to your server’s port 5432 (Postgres’ default port). To understand one can observe the meaning of the flags via  $ man ssh  to see what each of these flags doing.  It can be accessed via localhost tools like pgAdmin4 at localhost and port 5555 DB config would look like so:

How to delete a remote git tag

I'm always forgetting this. So decided to put it here for someone's benefit. I have the git tag added by command: git tag -a 1.2 . 0 -m "1.2.0" this means my tags tree will be updated with the tag 1.2.0 and message 1.2.0 Usually it marks the version of the build/release. I now push a tag to origin by command: git push origin --tags It is possible to see it at my repository github tagged. Time now to delete a tag. It can be done by command: git tag -d 1.2 . 0 This will remove a local tag 1.2.0. Leaving origin intact. Pushing tags to origin does not give anything. To remove a remote tag now it is required to execute command: git push origin :refs/tags/ 1.2 . 0 It will remove tag 1.2.0 at origin. This is the only way how to move tags to another commits.

install ssh-copy-id on Mac OS X best way

You often need to create identities for unknown/new servers. Then welcome to this article. I believe i have a best practice way of doing it on a MAC system. First of all you need your identity file: 1. Generating ssh keys set You need to use tool that any unix system usually has. It's ssh-keygen. (Skip if you have it already) Last login: Wed Aug 21 16 : 07 : 34 on ttys002 console@username:~$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/Users /username/ .ssh/id_rsa): yourkeyname Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in yourkeyname. Your public key has been saved in yourkeyname.pub. The key fingerprint is: XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX.XX. console@username The key 's randomart image is: +--[ RSA 2048]----+ | + | | + | | + | | + ...

SSH Unix/Lunux Recipes for daily usage.

I've decided to create a post with several recipes for commands I need to use daily. I use them from a Mac OS X Lion default console, except for some mac ports installed... Remote is special linux distribution. How do I Compress a Whole Linux or UNIX Directory?  You need to use tar command as follows (syntax of tar command): tar -zcvf archive-name.tar.gz directory-name Where, -z: Compress archive using gzip program -c: Create archive -v: Verbose i.e display progress while creating archive -f: Archive File name For example, you have directory called /home/garmoncheg/data and you would like to compress this directory then you can type tar command as follows: $ tar - zcvf data . tar . gz / home / garmoncheg / data / Above command will create an archive file called data.tar.gz in current directory. If you wish to restore your archive then you need to use following command (it will extract all files in current directory): $ tar - zxvf data . tar . gz Whe...

SSH: Mount remote file system on your Mac over SSH to access in Finder

    Maybe you're already know about how to connect to remote servers through Local network on your Mac, but how about SSH server connections?     Lets say you may open a terminal window and run "ssh username@server.com" it will ask you for a password and "Ta-da" we're in. But what about usability. If you're console geek, this is enough for you. As for the others let's talk about adding some GUI to it. Some time ago Google engineers released a package for Mac's to mount remote filesystems, using lots of methods, including SSH.     This software is called MacFuse. It connects remote filesystems to your Mac's finder. You will see it in your computer as a regular Mac's network drive.     MacFuse has developed to the point, where it's extremely easy to "make it work". This is the way:     1. Install MacFuse and SSHFS. at the time of writing this article version is  MacFUSE-2.0.3,2.dmg  and you can  dow...