Posts

Geminabox: Simple private RubyGems server on your own host

Image
Deploy private RubyGems repository You can easily setup private RubyGems repository with authentication from geminabox Docker image: docker run - d - v / path_where_to_store_gems : /webapps/ geminabox / data -- name geminabox - p 9292 : 9292 - P - h geminabox - e PRIVATE = true - e USERNAME = myuser - e PASSWORD = mypassword spoonest / geminabox : latest don’t forget to change: /path_where_to_store_gems - path on your local machine where you want to store your gems myuser - username mypassword - password Read more about geminabox repository on GitHub. That’s all. Your repository is accessible by url http://YOUR_HOST:9292 . Now you can use it to store you own gems you don’t want to share. Don’t forget to visit geminabox page for more information about this Docker image! Installing gems form your private repository Add following line at the top of your Gemfile : source 'http://myuser:mypassword@YOUR_HOST:9292' … and use bundle inst...

Git: display current branch name in the terminal

Image
As simple as beautiful trick for me. Add following lines to ~/.bashrc to allow your terminal to display the current branch name in the command line : get_git_branch () { git branch 2 > /dev/ null | sed - e '/^[^*]/d' - e 's/* \(.*\)/(\1)/' } PS1 = "[\u@\h \W\[\033[31m\]\$(get_git_branch)\[\033[00m\]]$ " Written with StackEdit .

Maybe? Run any command or script without a risk to loose your data

Image
Maybe it’s a simple Python tool that allows you to run any console command without changing your local files. Actually your command runs as usual except system calls that are about to make changes to file system - maybe tool intercepts them and your files stay untouched. Recommended to find detailed description how it works on the project page on GitHub . For example, you can see what happens when you want to create new file: .. or run some script: Installation First you need to install pip . Download it from here (safely): https://pip.pypa.io/en/stable/installing/#id8 and then run sudo python get-pip.py Then install maybe with: sudo pip install maybe Now you can try maybe : maybe touch new_file .txt Enjoy!!! Written with StackEdit .

Using Jenkins as HTTP server for your custom HTML

Image
Jenkins CI has its own small HTTP server after installation. You can use it easily when you need to publish your own html pages, e.g. code documentation such as Rdocs or YARD docs. To publish you content you need to put your files to /var/lib/jenkins/userContent directory (default path for Ubuntu installation). That’s it! Now you can find your pages on http://<your_jenkins_url>/userContent/your_page.html . As a result you’ve got http -server with restricted access for Jenkins users. Written with StackEdit .

Gedit: make links clickable (with Ruby script)

Image
Gedit is my favorite text editor in Ubuntu . It’s almost perfect for me. I use it for fast files editing or simple scripts writing when I don’t want to open my IDE . But I feel uncomfortable with Gedit when I cannot click links directly in text. We can fix it easily with External Tools plugin. All we need is to write a simple script (I prefer Ruby ) and run it through External Tools . Write Ruby script Create click_link.rb in your home directory. Paste following text to click_link.rb #!/usr/local/bin/ruby v1 = ARGV [ 0 ] require "uri" url = URI . extract ( v1 )[ 0 ] system ( "firefox #{url.to_s}" ) Do not forget to make click_link.rb executable chmod + x click_link . rb Create External Tool for Gedit Enable External Tools plugin in Preferences Tools > Manage External Tools Add new tool Paste following text #!/bin/sh /< your_path_to_file >/ click_link . rb $GEDIT_CURRENT_LINE Set Input = Current line and se...

Markdown for everyone

Image
I really love Markdown . It’s simple, fast and powerful. I’m trying to use it everywhere. Evernote and markdown Many years I was trying to use Evernote as my own knowledge base . After some weeks copy-pasting from different web sites my notes turned to a mess. Marxico - the best markdown editor I found which allows to sync notes with Evernote . If you have a lot of code in your notes you need something like Marxico to make your notes more structured and pretty. But Marxico has some minuses as well: it’s not free . Year subscription costs $24.99 USD. You cannot edit your posts in the Evernote directly. You still have to use Marxico to edit your posts. Blogging with markdown Markdown can also help you to blog easily. This post is written with Stackedit . Just type simple plain text in markdown , import it to Blogger in one click and you will get pretty html post in your blog. It’s very similar to Marxico but it doesn’t have Evernote integration. On the ...