Developers, I am pissed at you. A big chunk of your everyday duties involves source control. Not knowing how it works is unacceptable on many levels. FFS, this is developing 101. Learning GIT is in the core of every good training.
So, what is rebase? This will not be an essay, there is plenty of info on the net. I will just show you the sources:
Let’s input some commands in order to understand the most common case when rebase is needed and used. You have a remote branch (master, trunk, develop, etc). You create a working/feature/hotfix/etc local branch from the remote branch and start working. We all know that sometimes you work in a team with other developers, sysadmins, QAs and so on. They all do commits and merge them eventually. Some tasks take more time than couple of minutes, sometimes days. During this time, there are changes applied on the remote branch. When you finally push your changes, DANG. You see in your GIT provider (github, bitbucket, gitlab) that there is a conflict. And then .. you need to rebase. Please, don’t close your MR/PR, delete the branch and re-do the whole thing. Just learn how to use rebase. It’s not rocket science, I promise.
For the following git commands we will use master branch as an example but of course you can adjust it to your needs, I am sure 🙂
While you are on your local branch and hit a conflict the party starts. First we need to visit master branch (remote).
git checkout master
And pull the new remote changes that cause the conflict.
git pull origin master
When the changes are pulled, you can go back to your branch.
git checkout local-branch
git rebase master
In some cases you will need to clear some lines from the code but git will inform you for that. If this occurs, you need to clean whatever git wants and then do:
git add/rm file1 file2
git rebase --continue
When the work is done and you finally rebased properly, you can push. Because of the rebase, you will need to force push them.
git push --force origin local-branch
That’s all. Please rebase. Thanks.
Всеки потребител на интернет би трябвало вече да е запознат с чл. 13 и за какво служи. Все пак резюмирано: интернет доставчиците имат право да филтрират интернета, който предлагат. Това би довело до масова цензура, поръчкови новини и още по-голяма корупция. Също така, това е поредната стъпка към централизацията на интернета. НЕ ГО ЖЕЛАЕМ И НЕ НИ ТРЯБВА. Ако сте адекватен човек, подпишете ПЕТИЦИЯТА.
Recently, I needed huge photo database from which I can choose couple of images for an upcoming project of mine for the web site I am preparing. It is a product oriented web site but right now I don’t posses the product so it was simply impossible to pay for photographer. Until the product is here, I needed photos /or any graphical resources/. So, here is the list of what I’ve managed to collect:
Blog posts (in Bulgarian with free resources):
С момчетата от openSUSE България започнахме да обикаляме из родината и да проповядваме словото на гущера. През изминалата седмица се състоя събитието във VarnaLab.
На 26.04, т.е. утре, предстои събитието в София. Какво ще представлява?
В малко повече детайли, програмата изглежда така – ще започнем с кратък преглед на историята на SUSE и openSUSE, последван от представяне на екосистемата на SUSE/openSUSE, с маркиране на основните компоненти и връзките помежду им. След това ще кажем няколко думи за това какво всъщност е openSUSE и какво интересно има там, както за начинаещи, така и за професионални потребители. Накрая ще покажем в действие някои от по-интересните неща, за които сме говорили.
гр. София, бул. “Акад. Иван Гешов” 2Е, сграда 3, етаж 2.
За повече информация се обърнете към мен, към Димитър Захариев или Радо Панев!
I want to start off by saying that this is my very first time writing an article of any sort. Thanks to Rosen for letting me write as a guest on his awesome website. Anyhow, I hope you find the information below useful and practical as much as I have. Enjoy!
Several months ago, I quit Tech Support and started working as a Sys Admin for a storage company (still learning, there’s a looong way to go…). I knew about the power of SSH before, but on several occasions, I found out that creating SSH tunnels can be super useful and it gives you the freedom to quickly access devices from anywhere you want.
In my particular situation, I have a Raspberry Pi 3 sitting at home, up and running all the time, which I use for pretty much anything that I want to experiment with, whenever I get the chance… That last part is key: I want to be able to access the little gadget whenever I feel like it, and not be restricted by my location or the computer I’m accessing it from.
After I set up proper port forwarding in my home router (check the web if you don’t know how to do that yet, it’s very useful), I had to SSH to my external IP address and the specific port, which would in turn forward that to port 22 on my Raspberry Pi, allowing me to type my password at the prompt. Pretty basic procedure but I wasn’t really happy with the fact that I have to specify and address, a port, and type a password. I wanted to create some sort of an alias which would include all that information. I wanted the process to be as automated as possible, and after quite some time digging around on the web, here are the possible solutions that I found:
Simple SSH with an SSH key
You can always use sshpass and use the -p flag to give the password in the command itself, but this is not very safe, as anybody with access can check the CLI history or the current SSH session process (ps aux | grep ssh) and see the password.
Continue reading “How to create ssh tunnels and access locally any remotely hosted services”
I was extremely tired of typing hostnames of the machines we are using at the office. I had these days when I ssh to a single machine 20 times. And I don’t want to remember names or IPs. Of course, you can generate private keys and passphrase but if you don’t have this option or knowledge, you can make SSH alias to a common server. Follow few easy steps:
Use you favorite text editor, I like MC:
In the config file add these lines (and put your server settings):
By typing in the terminal “ssh ALIAS_NAME” this will lead you to the password prompt of the server instantly.
I want to share with you a script I wrote. It’s about quitting/killing your script process after X seconds, managed entirely by you. You should know that bash in not “smart”. Doing arithmetic operations can be painful. I needed a script which collect MySQL processlists. Of course this can be done manually but the thing is that I needed this to start on Monday, 1 AM. I am too lazy and sleepy to work at night. And I couldn’t risk to put a script in the crontab without exiting after the needed time. I cannot be sure how big logs I will collect. That’s why I wanted my script to finish at 3:00 AM.
echo “| |”
echo “|Logging full processlist every second! |”
UNIX_TIME_LIMIT=$(( UNIX_TIME_NOW + EXTRA_TIME ))
while [ “$UNIX_TIME_LIMIT” -gt “$UNIX_TIME_NOW” ];
mysql -u -p -e “show full processlist” | grep -v ‘Sleep’ | tee -a /your/dir/plist-$NOW.log
What the script does is calculating current time and adding extra time set by me. When the clock measures EXTRA_TIME the script will exit.