Using vue.js with Jekyll - double curly brace problem

If you are go full serverless, means you need to do lots HTML templating and Javascript juggling. For making templating easier (of course you can always do single page with vue.js and vue-router but I don’t like it for SEO purposes), I started to use Jekyll’s liquid templating system with proper layouts and includes. However, liquid uses double curly braces for templating just like vue.js template delimiters. This means that liquid will strip out all my vue.js tags at the time of the generation. This ended up no vue rendering. In order to solve this problem: I tried changing Vue delimiters to [[ ]] instead of `` -> Sadly didn’t resolve.Vue.config.delimiters = ['$[', ']'] Not cool but I tried using `` tags of jekyll to let {{}} go without being stripped out. And it worked.{% raw %}<p>{{ title }}</p>in JS file:data: { title: 'Who let the dogs out'}

Making crontab send email through mailgun

I have 3 raspberry pis and they have some crons on it. Although this is nice, I have hard time to keep track of which pi does what and if its cron has successfully completed. Thankfully there is an easy solution for that: Send an email after every cron run with logs. However, ubuntu or jessie (pi version of linux) is not capable of sending emails out of box. At least as far as I understand that is the situation so we need a mail provider to send emails. I already have an account from mailgun so why not using it? Did some research and combined some short commands to achieve this.i assume here that you have opened a account and you use crontab as cron job tool on some debian backed environment. Install crontab if you do not have:sudo apt-get install crontab Check the cron jobs:crontab -l Add/Remove/Edit the cron jobs:crontab -e Install postfix for mail sending relaysudo apt-get -y install postfix Choose from the prompts Satellite system username: desired_username ...

Windows 10'da Ubuntu Bash modunu etkinleştirmek

Artık windows 10 ile beraber beta olarak ubuntu subsystem kullanabiliyoruz. Bu kesinlikle virtualbox ya da cygwin tarzı bi sanallaştırma değil daha native bir sistem. Uzun zamandır istenen bi özellikti ve sonunda Microsoft ekledi bunu. Aktifleştirmek çok kolay: Başlat (Win) -> Ayarlar (Settings) -> Update & security Gelişitiricler (For developers) -> Use developer features -> Geliştirici modu (Developer mode) Denetim masası (Control panel) -> Programlar (Programs) -> Turn on/off Windows features Yeniden başlat İlk çalıştırmada bash.exe yi kendiniz tetiklemeniz lazım. Başlat -> bash yazıp çalıştırın O sizi yönlendirecek ve bittiğinde artık başlat’a bash yazıp çalıştırabilirsiniz. gcc, apt-get, nano, ssh, python, grep, ack hemen hemen her şey var. Hızlı bi gcc örneği Dosyayı yarattouch hello.c İçine kodunu yaz:nano hello.c Aşağıdakini yapıştırın:/* Hello World program */#include<stdio.h>main(){ printf("Hello World");} GCC’yi ubuntuya kurar...

Google Cloud SDK - how to bring back

This weekend’s annoying problem is this. New gcloud SDK is great, it is installed through Ubuntu Software Center (apt-get) etc. However, when you install it like that, even though you can deploy the Google App Engine apps; you would not be able to run the local server to see your changes locally for the python GAE app. Example: Run the development command not found List the components:gcloud components list│ Uninstalled │ gcloud app Python Extensions │ app-engine-python │ 6.1 MiB │ Install the python SDK to use dev_appserver.pygcloud components install app-engine-pythonOutput: You cannot perform this action because this Cloud SDK installation is managed by an external package manager. The reason is that it’s installed through apt-get, instead we should uninstall that version through apt and then reinstall in the old way.sudo apt-get updatesudo apt autoremove google-cloud-sdk Install in an old way, this will ask you...

Some nice #bash commands

#!/bin/bashMake all files lower case in the folder in linuxfor f in `find`; do mv -v "$f" "`echo $f | tr '[A-Z]' '[a-z]'`"; doneRename all files in the directory sequentiallya=1for i in *.mp4; do new=$(printf "%04d.mp4" "$a") #04 pad to length of 4 mv -- "$i" "$new" let a=a+1doneCheck if variable null (not set) or not if [ -z "$var" ] then echo "\$var is empty" fiFunction definitionmain (){ echo "This is a function" # Use the passed parameter in the function. echo "Passed parameter is $1"}main "first parameter"if-else conditionalsif [[ "$1" = "1" ]]; then echo "This is if"elif [[ "$1" = "2" ]]; then echo "This is elif"else echo "This is else"fiFormat current date and time in a nicelyecho "Recent logs are at logs_`date +%Y%m%d_%H%M%S`"Pipe both stderr and stdout to a filepython 80 > logs_`date +%Y%m%d_%H%M%S` 2>&1 &

Install latest #nodejs on raspberry pi (#raspbian)

First add the source:curl -sL | sudo -E bash -Install just like normal - don’t install node which is different.sudo apt install nodejsNow you can use it just like normal nodejs, this should output something like 7.blahnode -vNPM comes for free as well.npm -v

Solving pip error: ImportError: cannot import name IncompleteRead

$ sudo pip uninstall wheezyTraceback (most recent call last): File "/usr/bin/pip", line 9, in <module> load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() File "/usr/lib/python2.7/dist-packages/", line 356, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/dist-packages/", line 2476, in load_entry_point return ep.load() File "/usr/lib/python2.7/dist-packages/", line 2190, in load ['__name__']) File "/usr/lib/python2.7/dist-packages/pip/", line 74, in <module> from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/usr/lib/python2.7/dist-packages/pip/vcs/", line 9, in <module> from import path_to_url File "/usr/lib/python2.7/dist-packages/pip/", line 25, in <module> from requests.compat import IncompleteReadImportError: cannot import name IncompleteReadJust re-inst...

Complete Guide of OAuth API and Login Button

I play Overwatch like crazy and I use sites like overbuff and masteroverwatch.I like their login buttons and wanted to create a simple site to beat matchmaking system. I didn’t realize that this will be a huge struggle.Here are the official docs: this Chrome Extension to try get post requests, amazing extension including authentication features: up first Go to the and create a mashery account. Create your first app You can put localhost as callback url, you MUST put it as https://localhost https is really important let’s keep this in mind. Note your client key and secret and redirect_uri which must be an HTTPS url.Get authorization codeOauth is usually 2-steps. First you authorize the user and then use this authorization to obtain an access token in order to make requests to on behalf ...

Simplest Raspberry Pi 3 setup as a home server - Jan'17

I’ve just done it and I don’t want to forget this struggle. Buy a super fast 32 gb sd card - keep your adapter because most of the new computers only have sd card slots not micro sd slots. Format sd card as FAT - MSDOS with Disk utility -> Erase on Mac Right click -> Format on Windows Disks on Ubuntu Download NOOBS - easy UI to select which OS should be installed into your pi. Don’t bother flashing yourself with raspbian etc. Extract NOOBS zip and copy all of the files (if it’s extracted into a folder just copy its content, root of the sd card must have a couple of files, not one directory) Put your recently formatted and NOOBs copied sd card into the pi and then wait a little bit Plug your raspberry pi into micro usb Plug your monitor via an HDMI cable Plug your mouse and keyboard (mechanical keyboards take some time though to be recognized, just wait a little bit more) NOOBS UI will show up, for raspberry pi 3 you can connect to wifi. You ca...

Enable SSH access to your fresh Ubuntu install (16.10)

Leaving this here since I should not spend another hour to figure this out in my next fresh ubuntu install.Install ssh server first:sudo apt-get install openssh-server And open the port:sudo ufw allow 22Find your IP addressifconfig

subscribe via RSS