| @@ -4,3 +4,4 @@ _site | ||
| 4 | 4 | */.DS_Store | 
| 5 | 5 |  | 
| 6 | 6 | node_modules/ | 
| 7 | +.ftppass | 
| @@ -0,0 +1,36 @@ | ||
| 1 | +module.exports = function(grunt) { | |
| 2 | + | |
| 3 | +  grunt.initConfig({ | |
| 4 | +    pkg: grunt.file.readJSON('package.json'), | |
| 5 | +    jshint: { | |
| 6 | + files: ['Gruntfile.js'], | |
| 7 | +      options: { | |
| 8 | +        globals: { | |
| 9 | + jQuery: true | |
| 10 | + } | |
| 11 | + } | |
| 12 | + }, | |
| 13 | +    'sftp-deploy': { | |
| 14 | +      build: { | |
| 15 | +        auth: { | |
| 16 | + host: 'j1x.co', | |
| 17 | + port: 22, | |
| 18 | + authKey: 'key1' | |
| 19 | + }, | |
| 20 | + src: '_site', | |
| 21 | + dest: '/var/www/j1x-blog/public_html/', | |
| 22 | + exclusions: ['/_site/**/.DS_Store', '/_site/**/Thumbs.db', '_site/tmp'], | |
| 23 | + serverSep: '/', | |
| 24 | + concurrency: 4, | |
| 25 | + progress: true | |
| 26 | + } | |
| 27 | + } | |
| 28 | + }); | |
| 29 | + | |
| 30 | +  grunt.loadNpmTasks('grunt-sftp-deploy'); | |
| 31 | + | |
| 32 | +  grunt.registerTask('deploy', [ | |
| 33 | + 'sftp-deploy' | |
| 34 | + ]); | |
| 35 | + | |
| 36 | +}; | 
| @@ -23,8 +23,8 @@ Now with the super user created switch from root to the new user: | ||
| 23 | 23 |  | 
| 24 | 24 | Create a new folder for **SSH** keys and modify its permissions: | 
| 25 | 25 |  | 
| 26 | - mkdir .ssh | |
| 27 | - chmod 700 .ssh | |
| 26 | + sudo mkdir .ssh | |
| 27 | + sudo chmod 700 .ssh | |
| 28 | 28 |  | 
| 29 | 29 | Now create a new file for your SSH key and paste your public key inside of it: | 
| 30 | 30 |  | 
| @@ -66,6 +66,20 @@ And thats it! Now when you log out of the root account, you wont be able to log | ||
| 66 | 66 |  | 
| 67 | 67 | If you ever have to log in as the root user again, just change this settings back as your new super user using ```sudo``` before the commands. | 
| 68 | 68 |  | 
| 69 | +## Configure FTP | |
| 70 | + | |
| 71 | + sudo apt-get install vsftpd | |
| 72 | + | |
| 73 | +To change vsftpd configuration, run ```sudo nano /etc/vsftpd.conf```. Change the following settings: | |
| 74 | + | |
| 75 | + local_enable=YES | |
| 76 | + write_enable=YES | |
| 77 | + chroot_local_user=NO | |
| 78 | + | |
| 79 | +With this configuration, the admin user will be able to log in via SFTP to any folder inside ```/var/www/```. After changing configurations, restart the service: | |
| 80 | + | |
| 81 | + sudo service vsftpd restart | |
| 82 | + | |
| 69 | 83 | ## Change SWAP memory settings | 
| 70 | 84 |  | 
| 71 | 85 | For droplets with a low amount of RAM memory, its possible to increase the **SWAP memory**. | 
| @@ -75,12 +89,52 @@ For droplets with a low amount of RAM memory, its possible to increase the **SWA | ||
| 75 | 89 | $ sudo swapon /mnt/swap.img | 
| 76 | 90 | $ sudo vim /etc/fstab | 
| 77 | 91 |  | 
| 92 | +## Install zshell | |
| 93 | + | |
| 94 | +To install zshell and set it as your default shell: | |
| 95 | + | |
| 96 | + apt-get install zsh | |
| 97 | + apt-get install git-core | |
| 98 | + wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh | |
| 99 | + chsh -s `which zsh` | |
| 100 | + | |
| 101 | +After installing **zshell**, exit the *ssh session* and log back in. | |
| 102 | + | |
| 103 | +## Install slap | |
| 104 | + | |
| 105 | + sudo apt-get remove --purge node | |
| 106 | + sudo npm cache clean | |
| 107 | + sudo apt-get install build-essential | |
| 108 | + curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - | |
| 109 | + sudo apt-get install -y nodejs | |
| 110 | + sudo ln -s /usr/bin/nodejs /usr/bin/node | |
| 111 | + | |
| 112 | +## Change hostname | |
| 113 | + | |
| 114 | +To check the actual server hostname, run ```hostname --fqdn```. Then to change to a different hostname run: | |
| 115 | + | |
| 116 | + sudo hostname name.example.com | |
| 117 | + | |
| 118 | +## System info with Archey | |
| 119 | + | |
| 120 | +To install run: | |
| 121 | + | |
| 122 | + sudo apt-get install lsb-release scrot | |
| 123 | + wget http://github.com/downloads/djmelik/archey/archey-0.2.8.deb | |
| 124 | + sudo dpkg -i archey-0.2.8.deb | |
| 125 | + | |
| 126 | +To use, just run the command ```archey```. | |
| 127 | + | |
| 78 | 128 | ## Usefull commands | 
| 79 | 129 |  | 
| 80 | 130 | * ```sudo poweroff``` - turn off the droplet. It can be turned back on in the droplet control pannel. | 
| 81 | 131 | * ```sudo reboot``` - restarts the server. | 
| 82 | 132 | * ```landscape-sysinfo``` - simple system information. Use can use the flag ``` --exclude-sysinfo-plugins=Temperature,LandscapeLink,Processes```. | 
| 83 | 133 |  * ```find /usr/share/figlet -name *.?lf -exec basename {}  \; | sed -e "s/\..lf$//" | xargs -I{} toilet -f {} {}``` - Show demo of toilet fonts | 
| 134 | +* ```sudo apt-get clean``` - remove files from incomplete installations. | |
| 135 | +* ```sudo apt-get autoremove``` - remove unused packages. | |
| 136 | +* ```sudo apt-get update``` - update the package manager. | |
| 137 | +* ```sudo apt-get upgrade``` - update installed apps. | |
| 84 | 138 |  | 
| 85 | 139 | ## Links | 
| 86 | 140 |  | 
| @@ -34,6 +34,8 @@ Install apache2: | ||
| 34 | 34 | sudo a2enmod proxy_http | 
| 35 | 35 | sudo a2enmod proxy | 
| 36 | 36 | sudo a2enmod rewrite | 
| 37 | + sudo a2enmod ssl | |
| 38 | + sudo a2enmod headers | |
| 37 | 39 | sudo /etc/init.d/apache2 restart | 
| 38 | 40 |  | 
| 39 | 41 | If apache doesnt work with the [error](https://www.digitalocean.com/community/questions/98-address-already-in-use-ah00072-make_sock-could-not-bind-to-address-80-error): | 
| @@ -62,7 +64,7 @@ This command will show all lines that have the word "listen", including the port | ||
| 62 | 64 |  | 
| 63 | 65 | In ```/etc/gitlab/gitlab.rb``` modify: | 
| 64 | 66 |  | 
| 65 | - external_url "http://gitlab.example.com:4554" | |
| 67 | + external_url "http://gitlab.example.com" | |
| 66 | 68 | # Disable nginx | 
| 67 | 69 | nginx['enable'] = false | 
| 68 | 70 | # Give apache user privileges to listen to GitLab | 
| @@ -124,7 +126,9 @@ Then bind GitLab virtual host to enabled sites and restart apache: | ||
| 124 | 126 | sudo a2ensite gitlab | 
| 125 | 127 | sudo service apache2 restart | 
| 126 | 128 |  | 
| 127 | -Then run ```sudo gitlab-ctl reconfigure``` to reload GitLab configurations. | |
| 129 | +Then run ```sudo gitlab-ctl reconfigure``` to reload GitLab configurations. If you need to restart the server, use the command ```sudo gitlab-ctl restart```. | |
| 130 | + | |
| 131 | +If by any chance you have to change the git-data file, its locate in ```/var/opt/gitlab/git-data```. | |
| 128 | 132 |  | 
| 129 | 133 | ## Links | 
| 130 | 134 |  | 
| @@ -0,0 +1 @@ | ||
| 1 | +{"_site/404.html":"2015-09-12T18:34:19.000Z","_site/feed.xml":"2015-09-12T18:34:19.000Z","_site/gulpfile.js":"2015-09-12T18:34:20.000Z","_site/humans.txt":"2015-09-12T18:34:20.000Z","_site/index.html":"2015-09-12T18:34:19.000Z","_site/sftpCache.json":"2015-09-12T18:34:20.000Z","_site/about/index.html":"2015-09-12T18:34:19.000Z","_site/assets/css/main.css":"2015-09-12T18:34:19.000Z","_site//404.html":"2015-09-12T18:34:19.000Z","_site//feed.xml":"2015-09-12T18:34:19.000Z","_site//gulpfile.js":"2015-09-12T18:34:20.000Z","_site//humans.txt":"2015-09-12T18:34:20.000Z","_site/assets/css/main.min.css":"2015-09-12T18:34:19.000Z","_site/assets/css/prism-line-numbers.css":"2015-09-12T18:34:19.000Z","_site/assets/css/prism-okaidia.css":"2015-09-12T18:34:19.000Z","_site/assets/images/buffer.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/demo.png":"2015-09-12T18:34:19.000Z","_site/assets/images/dribbble--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/facebook--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/facebook.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/favicon.ico":"2015-09-12T18:34:19.000Z","_site/assets/images/github--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/google+.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/heart.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/kiva--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/linkedin--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/linkedin.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/logo-black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/logo-text-black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/logo-text-white.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/logo-white.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/pinterest--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/pocket.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/rss--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/twitter--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/twitter.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/vimeo--black.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/ycombinator.svg":"2015-09-12T18:34:19.000Z","_site/assets/images/youtube--black.svg":"2015-09-12T18:34:20.000Z","_site/assets/images/hero/atom-editor.jpg":"2015-09-12T18:34:19.000Z","_site/assets/images/hero/hello-world.jpg":"2015-09-12T18:34:19.000Z","_site/assets/images/hero/j1x-whois.jpg":"2015-09-12T18:34:19.000Z","_site/assets/images/hero/raspberry-pi.jpg":"2015-09-12T18:34:19.000Z","_site/assets/images/thumbnail/atom-editor.jpg":"2015-09-12T18:34:19.000Z","_site/assets/images/thumbnail/hello-world.jpg":"2015-09-12T18:34:19.000Z","_site/assets/images/thumbnail/j1x-whois.jpg":"2015-09-12T18:34:19.000Z","_site/assets/images/thumbnail/raspberry-pi.jpg":"2015-09-12T18:34:19.000Z","_site/assets/javascripts/imagesloaded.pkgd.min.js":"2015-09-12T18:34:20.000Z","_site/assets/javascripts/prism.js":"2015-09-12T18:34:20.000Z","_site/assets/javascripts/plugins/prism-line-numbers.min.js":"2015-09-12T18:34:20.000Z","_site/atom-editor-setup/index.html":"2015-09-12T18:34:19.000Z","_site/hello-world/index.html":"2015-09-12T18:34:19.000Z","_site/raspberry-pi-getting-started/index.html":"2015-09-12T18:34:19.000Z","_site/whois-json-api/index.html":"2015-09-12T18:34:19.000Z"} |