Every time i start building a product for a new company, one of the first step is creating a repository and uploading SSH key. Instead of browsing the web looking for a reminder on how to do it, i decided i’ll post the quickest solution here.
1. Enter the following command in the Terminal window (Mac OS X)
ssh-keygen -t rsa
2. Accept default location and leave password blank (or not, up to you)
3. The key will get generated
Your identification has been saved in /Users/mariuszprzydatek/.ssh/id_rsa.
Your public key has been saved in /Users/mariuszprzydatek/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
+--[ RSA 2048]----+
| . |
| E . |
| . . o |
| o . . S . |
| + + o . + |
|. + o = o + |
| o...o * o |
|. oo.o . |
4. The private key (id_rsa) is saved in the .ssh directory and used to verify the public key. The public key (id_rsa.pub) is the key you’ll be uploading to your GitLab account.
5. Copy your public key to the clipboard
pbcopy < ~/.ssh/id_rsa.pub
6. Paste the key to GitLab
Ever wondered how nice it would be, to always know which git branch you’re current on, in a given directory? If so, then i encourage you to give Prezto — Instantly Awesome Zsh a try.
You’ll find it here (as well as instruction on how to install):
Prezto integrates nicely with (among others):
iTerm2, SSH, Ruby, Git, various editors, etc.
In this step-by-step guide i’ll show you how to install Redis on AWS (Amazon Linux AMI).
I’ll assume you’re performing steps below as a su (sudo -s).
- First thing you need is to have following tools installed:
yum -y install gcc gcc-c++ make
- Download Redis:
tar xzf redis-2.8.12.tar.gz
rm -f redis-2.8.12.tar.gz
- Build it:
- Create following directories and copy binaries:
mkdir /etc/redis /var/redis
cp src/redis-server src/redis-cli /usr/local/bin
- Copy Redis template configuration file into /etc/redis/ (using Redis port number instance as its name (according to best practices mentioned on Redis site)):
cp redis.conf /etc/redis/6379.conf
- Create directory inside /var/redis that will act as working/data directory for this Redis instance:
- Edit Redis config file to make necessary changes:
- Make following changes to 6379.conf
> Set daemonize to yes (by default it is set to no).
> Set pidfile to /var/run/redis.pid
> Set preferred loglevel
> Set logfile to /var/log/redis_6379.log
> Set dir to /var/redis/6379
- Don’t copy the standard Redis init script from utils directory into /etc/init.d (as it’s not Amazon Linux AMI/chkconfig compliant), instead download the following:
- Move and chmod downloaded redis init script:
mv redis-server /etc/init.d
chmod 755 /etc/init.d/redis-server
- Edit redis-server init script and change redis conf file name as following:
- Auto-enable Redis instance:
chkconfig --add redis-server
chkconfig --level 345 redis-server on
- Start Redis:
service redis-server start
- (optional) Add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf (otherwise background save may fail under low memory condition – according to info on Redis site):
> vm.overcommit_memory = 1
- Activate the new sysctl change:
- Try pinging your instance with redis-cli:
- Do few tests with redis-cli and check that the dump file is correctly stored into /var/redis/6379/ (you should find a file called dump.rdb):
>set testkey testval
- Check that your Redis instance is correctly logging in the log file:
And that would be basically it. Cheers.