Markus Tenghamn

Programmer and Entrepreneur

Fight Piracy With Marketing!

27th of March, 2016

If you are a publisher like me you will notice that the things you create will appear on torrenting sites every now and then which allows anyone to download your addon for free. Personally I don’t fight piracy by filing DMCA notices, asking to have it removed and such. I believe that doing something like that is only a waste of my time and someone will probably upload everything again once it is taken down. By letting it be it allows users to test my creation and I believe that those who truly like what I do will purchase what I have created.

Now building on this idea that people want to test my creation, what if I give out free samples or test versions? What if I do this via torrents? There is nothing illegal about torrents themeselves and you are free to distribute your own work. This will also flood the torrents with real versions and test versions making it harder to actually steal your creation but still allowing those who want to test your creation to test it in a way that you can control it without it costing anything for the user.

A while back I created a simple addon which has had a few small sales and I decided to use this as an example to show you how to do marketing with torrents to fight piracy. So to get started, my addon is called MyMail Better Export which is a WordPress addon for the plugin called MyMail which is used to send out newsletters.

So let’s begin, I will take the files for my addon and make some modifications. The main aspect is the export function of my addon, for this example I am completely going to remove that page and instead show a promt that thanks the user for trying my addon and encourages the user to buy the addon from my CodeCanyon page.

MyMail Better Export test versionIf you create videos or something like that you could cut out important parts of a video and show the user where to pay for the video. Another option if you want to support learning for those who can not afford your videos is to simply heavily water mark the free version but still allow users to see the material and learn from it.

Anyways, after my changes I put everything in a zip file and downloaded BitTorrent which is completely free to use to upload and download torrents. We will use this to create our torrent file. Simply go to File->New torrent in the menu in the top left corner. This should bring up the following page.

Create a Torrent With BitTorrentSo here you need to select the file or directory which contains all of your creative work. In my case this is a simple zip file. For the trackers section i used a list of public trackers which can be found here: Torrent Tracker List 2016. I also added a comment that described what this was, “MyMail Better Export WordPress Addon”. I don’t make a mention of a test version as we want to make it hard to tell a difference between our test version and the illegal versions uploaded by others (the piracy we want to fight). Check the box “start seeding” and you will automatically start sharing your test version. If you want you can also register an account with some of the popular torrent sites that are out there and add your torrent to their trackers.

There is your free marketing and it is not a completely original idea by me, many have done it before I published this post such as this game development company called Greenheart games. They make a game where you run your own game development company and they created a different version of the complete game and uploaded it to torrent sites, the only difference being that the torrented version had a hidden feature causing the player to go bankrupt towards the end of the story because so many users would pirate their games. You can read more about this story here: What happens when pirates play a game development simulator and then go bankrupt because of piracy?

Some things to keep in mind when you are uploading your test version is to keep it the same file size as your original version or at least very close. No one is going to download a full hd movie which is smaller than a short mp3 file. Also keep the same names of files and the same structure as your original, you should simply be changing the content.

I wish that more companies would take this approach rather than pursuing huge lawsuits and DRM which sometimes makes pirating easier and faster than buying the actual creation. I am definitely not saying pirating is ok but I believe there is a middle ground that can be reached in order to make things better for everyone.

Voice calling is now available in Slack (beta)

20th of March, 2016

If you didn’t already know, Slack is this awesome piece of software which lets you message, share files with and now call other members of your team and you can use it for free if you are unsure about it’s benefits. After Slack aquired Screenhero they began integrating Screenhero’s features into slack. Voice calling is the first of those features and hopefully we will see video and screensharing services coming to Slack in the near future. Voice calling is available in DM conversations for free, paid teams can use the calling feature in channels. So let’s take a look at how it works.

Testing the voice calling features in Slack

To start a call simply go to the conversation or channel which you would like to start a call for and click the phone icon at the top of the screen. Members of that channel or conversation will see the notification as a message in the slack channel. If you are starting the call with a single person they will see it as a call and can answer it via slack as a normal phone call.

Voice calling in slack allows for emojis/reactionsOnce a call has started you can invite more users by clicking the “+” sign in the top right corner. As someone is talking other users can show their reactions by simpy clicking emojis. This may seem a bit silly at first but is a pretty good way to show approval or disapproval of someone who is speaking without interrupting them. Simply click the smiley to bring up the available emojis, clicking on one of these will display the amoji on top of your profile picture inside the call. In the top left corner you have a share button to invite users who are not part of the team to the call. You could post this in an email or perhaps on twitter if you would like to allow for a more public conversation.

I love what Slack has done, simple improvements that may become standard practice in future chat applications and I can’t wait to see what they will do with video calls and screen sharing. And as I mentioned before, you can try Slack for free for an unlimited time.

Being an Open Networker on Linkedin makes you look bad

19th of March, 2016

Today I want to share a bit of a personal experience regarding Linkedin and open networking. There are reasons for doing this and there are reasons why you really should stay away from it, for most of us there will be more cons than pros of being an open networker. Unless you strictly use Linkedin to sell or promote something and you don’t network with people who you meet in real life then you probably don’t want to be part of open networking and I will tell you why.

However, let’s first begin with why I tried open networking and what I wanted to get out of it. I was a small business owner with around 200 connections on linkedin, people liked what I did and my profile looked pretty nice on linkedin compared to others. However there was one thing my profile lacked which many other profiles had, and it was the nice 500+ connections shown on the profile instead of 234 or whatever I had at the time. Here is what my profile looks like today and as you can see I have the “500+” shown there.

Being an Open Networker on Linkedin makes you look badMy solution to get that “500+” was pretty simple after a bit of googling, all I had to do was to become and open networker, simply submit my email to a group called LION (Linkedin Open Networkers) and in return I got a list of hundreds of people I could add who had promised to accept my invitation to connect. An Open Networker is someone who will basically add anyone to their network and agrees to accept all invitations to connect. Many of these people may show LION next to their name and they will usually also write the number of connections they have if they have a lot, some have 30,000 or more. You can read more about LION and how it works via: What is a Linkedin LION.

Great! I quickly had 500+ connections and some looked pretty good as they were CEOs and the like, but then the spam started raining in. I quickly realized that I had made a mistake as I started receiving messages like “Thanks for connecting, please take a look at my website” or “I see that you work in an IT field, we are here to help, hire us now”. A lot of this stuff is what you try to filter out of your inbox but I had added these people, I had told linkedin that I knew who they were and they had accepted my invite telling linkedin they knew who I was even though they did not. I still wanted my 500+ connections so I let it be but I stopped accepting invites from strangers and took myself off the LION list, or at least did my best to get myself removed.

However the worst part comes when I started working at other companies instead of running my own business on my own. Now people who I worked with closely started adding me on Linkedin and I was happy to accept and my “fake” LION connections that were still there were happy to ask all my new connections to connect (Which I did not think about untill someone asked how I knew this and that person). Suddenly my close friends and co-workers were getting invitations to connect from strangers that I did not know but Linkedin would present them in a way that made it look like I endorsed them for being real, serious and respectable persons. Afterall I had told Linkedin that I knew them when I added them. My real connections would then suffer from the same spam that I had endured when I first added all these connections.

As a result of this I have spend many hours, we are talking weeks, filtering out people I don’t know from people that I do know which has to be done manually one by one. And finally my linkedin profile has 95% real connections that I have met in person, I am sure I missed a few fake ones but I will continues filtering out the bad ones when I see it. After all this I realized that it probably would not have taken me very long to get to the “500+” number without being and open networker and that the number of connections did not really matter in the first place. What matters is the quality of your Linkedin profile and the quality of your connections.

So unless you are looking to spam people, don’t become an open networker and make the same mistakes I did.


A Good Way To Attract Web Developers To Your Company

1st of March, 2016

I have seen examples of Google doing something like this when you search for specific things on their website and a sort of job offer pops up. This is a much simpler example of this but still something that can come across as pretty cool as web developers stumble across it. I was messing around with things on a swedish website called, they provide information on both businesses and private people, a sort of searchable directory. As I was looking around I opened the console and saw the following pop up.

5819e23650165144973ad1660db9b453Translated it starts off with “” and then goes on to say “Become one of us – send your resumé to” which surprised me a bit. I think it is a pretty cool way to catch the interest of developers. It may not reach tons of people but you can be pretty sure that this “ad” is pretty well targeted and it definitely got my attention when I saw it. It is also so simple and I wish that more companies would do this, even better if it is done as a secret easter egg as it shows that the company can be a bit clever and the developer will feel sort of special as he or she managed to find this easter egg by accident and perhaps no one else did.

This sort of thing is very simple to do, just add some javascript code like

console.log('Your message goes here');

and it will echo out your message to the console whenever someone visits your website. If they have their console open which usually only web developers will have then they should see the message. Of course you can always ask a skilled web developer to hide the message as an easter egg if you can set a specific criteria for who you want to hire. As Google might do when someone searches for a solution to complicated code. Wether or not you could do this on your own website depends on what your company does, be creative, there is always a way to do something.

Fixing auto increment on MySQL tables when foreign key constrainst fail

9th of February, 2016

Please note that you should NOT do this if you don’t know what is wrong. Foreign keys are there for a reason and bypassing them could cause you to lose data and break applications.

Lately I had been dealing with a large mysql import where the export had been handled wrongly and thus caused all of my database tables to lose auto increment on the id field. When trying to add this auto increment back I would get foreign key constraint failed errors.

To get around this error you can turn off foreign key checks while running your query. This will allow you to bypass the restrictions while fixing the database structure. I used the following code to fix all my tables.

SET foreign_key_checks = 0;
SET foreign_key_checks = 1;

On the first line we turn off foreign key checks allowing us to make changes to the table freely. On the second line we change our table to use auto increment, replace “tablename” with the name of your table and change “id” to the name of your column. On the third line we turn foreign key checks back on again.

Making large selections quickly in Sublime

8th of February, 2016

So tonight I was editing a large sql file, a few million lines and the import got stuck about half way through. The easiest solution would be to edit the sql dump and I needed a quick way to remove half the text in the file. At first I tried finding the line and manually selecting the lines but realized that it would take forever. So how in the world do I make large selections quickly?

Thats when I headed to Google to find the best way of doing this. After a bit of searching I stubled across a thread called Large Selection/Highlight or Select Range by Line Number . With a nice answer regarding markers in Sublime.

So basically all you have to do is scroll to the line where you want to make your selection from and click Edit->Mark->Set mark.


Then scroll to the line where you want your selection to go to and click Edit->Mark->Select to mark

Splitting huge video files that can’t be opened in Adobe Premiere

6th of February, 2016

So last night was game night and I was recording the newly released XCOM 2 with BigSwedish for several hours using OBS. OBS allows me to record on multiple audio channels so that I have myself speaking on one channel, Skype and whoever I am talking to on one channel and the actual game audio on a third channel. This makes it easier to edit in Premiere but it also makes for some very big files. This morning I wake up to begin editing my file and notice that its 40GB and importing it to Premiere either seems to freeze my computer completely or simply crash the program. Thus I realized that I needed to cut this file into smaller pieces but I had no idea what program to use. Splitting the file would not be as easy as I had hoped.

One option is to use VLC media player to record the video that is playing and use the recorded file, however this did NOT work for me as VLC did not preserve the video quality and also seemed to mess upp my audio tracks. I kept searching and tried many different programs, some programs I skipped as they seemed to be malware/spyware (Be careful when searching for free stuff). Finally looking at some forum posts got me going in the right direction to find a solution to my problem.

How I solved it

Avidemux solved all of my problems. It basically gives you the same capabilities as cutting video with premiere pro but in a much simpler interface. This program lagged for a few seconds but had no trouble loading my video file. I could also drag the slider to the needed position and set the markers for when I wanted to begin my cut and end it (just like Premiere). Once you have set your markers all you need to do is save your video and you are done! I love that Avidemux has the ability to simply copy the video and audio output. Avidemux should run fine and be perfect for splitting video on Unix, Mac or Windows. I hope this post helps some users who may be stuck with the same problems I had.

If you know of an even better way of doing video splitting please do let me know in the comments below!

Laravel and keeping my bitcoin bot running forever

23rd of January, 2016

So I was trying to figure out how to keep a script running forever as I want to constantly get social media updates and feeds from bitcoin exchanges when I use my bot to trade. Previously I would have done this with a bash script that would check for a tmp file that would be generated when the script was running and removed when it stopped, The script would be accessible as a console command in laraval making it easy to run. However, this could sometimes fail as well. I figured there must be a better way to achieve what I want to do.

I headed over to Reddit and posted my question where I have gotten a lot of help before and got a really useful answer from mbdjd. I had overlocked the cron section of the Laravel documentation that mentions the withoutOverlapping() method which would basically start my script whenever it stopped and keep it running at all times.

Bash script for new Laravel install on Ubuntu 14

23rd of January, 2016

The following is a simple script that I have used to set permissions on development builds for Laravel, it usually fixes permission issues and gets me up and running quickly. You can put it into a .sh file to run all the commands or simply copy and paste. I also have this running with git as a post-receive hook that will copy the master branch to a testing server.

mkdir bootstrap/cache/;
mkdir storage/framework/cache;
mkdir storage/framework/views;
mkdir storage/framework/sessions;
sudo chown -Rf $USER:www-data .;
sudo chmod -R o+w storage;
sudo chmod -R o+w bootstrap/cache;
sudo chown -Rf www-data:www-data bootstrap/cache;
sudo chown -Rf www-data:www-data storage;
php artisan clear-compiled;
php artisan config:clear;
php artisan optimize;
php artisan migrate;
php artisan db:seed;
sudo apt-get install npm;
sudo apt-get install node;
npm install gulp; 
npm install laravel-elixir; 
sudo gulp;