Thor Erik’s blog

Just another blog

about me

 My name is Thor Erik, I’m 23 years old, you can read more here: About me

found on

Xiaomi M2 and ADB

- - posted in Android, M2, Mi2, Xiaomi, adb | Comments

I have been using the Xiaomi M2 as my primary phone now for quite some time, and it is probably the best phone I have ever owned, but I’ve been struggling with one thing… adb.

I had managed to get it to work on my linux machine at home, but not on my Mac or on Windows, so I started googling, a lot, and eventually found my way to this post on miui.com.

What I wound up adding to my adb_usb.ini was the following:

1
2
3
0x2717
0x8087
0x2080

My phone bears a different ID than what most does (0x2717), mine is 0x2080 (something I found while fiddling with it to make it work on linux) and 0x8087 was suggested, and appearantly worked, for a french user.

Fun With Twitter Cards

- - posted in Cards, Octopress, Twitter, Twitter Cards | Comments

Today I implemented Twitter Cards on this blog, and turned out to be relatively easy.

In your source/_includes/custom/head.html, add the following:

(head.html) download
1
2
3
4
5
6
7
8
9
10
11
12
13
{% if site.twitter_user %}
{% if page.preview %}
<meta property="twitter:card" content="photo">
<meta property="twitter:image:src" content="{{ page.preview }}">
<meta property="twitter:image" content="{{ page.preview }} ">
{% else %}
<meta property="twitter:card" content="summary">
{% endif %}
<meta property="twitter:site" content="{{ site.twitter_user }}">
<meta property="twitter:url" content="{% if canonical %}{{ canonical }}{% else %}{{ site.url }}{% endif %}">
<meta property="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
<meta property="twitter:description" content="{{ description | strip_html | condense_spaces | truncate:200 }}">
{% endif %}

Some of the above code is derived from Hari Menon on this. The above code defaults to the summary theme, but if you add preview: with a link to an image like below, you will get it to use the photo template, but do remember, your site must get it as well as the summary cards validated before you can use either.

1
2
3
4
5
6
7
---
layout: post
title: "something"
date: 2013-05-18 13:37
comments:true
preview: http://yoursite.com/someimage.jpg
---

Funny Samba

- - posted in IPv6, Linux, Samba, fstab | Comments

Today I found that SAMBA/CIFS don’t like IPv6 on linux.

I decided to roll out IPv6 on my internal network, and all of a sudden I could not mount up my cifs share where all my files are stored. When mounting it using mount -v I got the following:

thor@gw-01 /mnt> sudo mount WebsiteFiles/ -v
domain=domain
mount.cifs kernel mount options: ip=fd80:1337::f8bc:c46b:daed:b64a,unc=\\storage-01\WebsiteFiles,file_mode=0777,dir_mode=0777,uid=33,gid=33,user=Administrator,,domain=domain,pass=********
mount error(115): Operation now in progress
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Once I switched over to using the ip of storage-01 it started behaving more correctly again.

Caching Wordpress. Part 1

- - posted in Caching, Wordpress, nginx | Comments

Diving into caching plugins for Wordpress

Getting started

Today I started optimising my other site thorerik.com, and in the process i decided to do a quick test of how well my blog(my old Wordpress based blog) ran in comparison.

The result was terrifying at best, a measly 7 requests per second when hosted with NGINX front-end, IIS as app server using php on fcgi.