Skip to content

Instantly share code, notes, and snippets.

@githubutilities
githubutilities / README.md
Created March 8, 2015 13:09
Multiple SSH Keys for Multiple Github Accounts

Multiple SSH Keys for Multiple Github Accounts

Generate another ssh key

# generate ssh key and save to `id_rsa_another`
$ ssh-keygen -t rsa -C "[email protected]"

# save your key
@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:16
AirPlay Hacks

Airplay Hacks

Turn your mac into airplay server

  • reflector
  • airserver

Extends your Mac screen with your iPhone or iPad

@githubutilities
githubutilities / README.md
Last active May 15, 2023 11:42
Free or cheap VPS
@githubutilities
githubutilities / README.md
Last active April 20, 2023 09:50
Encoding Problem with `tar` file

Encoding problem with tar file

Both 7zip and rar support international character, but since tar file does not have encoding attribute, it only support ascii character. For tar file that works on windows, it may encounter a character encoding problem in mac or linux.

Convert encoding of a text file

iconv --from-code=gb2312 --to-code=utf-8 < readme.txt > out.txt
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
namespace KlerksSoft
{
public static class TextFileEncodingDetector
{
/*
@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:17
Image Hacks With ImageMagick

Generating Pure Image Background

convert -size 1366x768 canvas:yellow  yello_bg.gif

Changing image background

@githubutilities
githubutilities / README.md
Created March 17, 2015 16:44
Cannot connect to iTunes store

fix cannot connect to iTunes store error

You may get this error if you change to Hong Kong apple server. To fix this problem, go to Settings > iTunes & App Store > Tap your apple account > change your region to US. Done!

@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:17
Dev Setup Java EE logs

Dev Env Setup for J2EE

  • install glassfish and tomcat by homebrew
  • install glassfish eclipse plugin by Help > Eclipse Marketplace

Installation

It seems that Oracle use glassfish for Java EE distribution on Mac. And there are modules directory under glassfish directory which contains javax.servlet and so on, refer to here.

@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:17
Maven Usage Logs

Maven Usage Logs

  • add maven mirrors to settings.xml for faster download speed.

settings.xml may live in:

  • The Maven install: $M2_HOME/conf/settings.xml
  • A user’s install: ${user.home}/.m2/settings.xml
  • Use mvn archetype:generate to scaffolding
@githubutilities
githubutilities / README.md
Created April 2, 2015 10:30
Mac OSX Finder research

Mac OSX Finder Preference Little Experiment

.DS_Store known as Desktop Services Store, is used by Finder to store personal preference such as icon position and so on. It is good that Apple keep the preference locally by using .DS_Store but sometimes it might be annoying.

Experiment on .DS_Store

  • rearrange icon in your Picture folder
  • use Terminal to delete the .DS_Store file in Picture folder
  • relaunch Finder service using killall -KILL Finder command which will force Finder to reload .DS_Store