Skip to content

Instantly share code, notes, and snippets.

@amekusa
Last active January 20, 2016 09:22
Show Gist options
  • Select an option

  • Save amekusa/57bed7321595d2a29ef6 to your computer and use it in GitHub Desktop.

Select an option

Save amekusa/57bed7321595d2a29ef6 to your computer and use it in GitHub Desktop.
Random TIPs

Random TIPs

OS X

How to get rid of firewall “accept incoming connections” dialog

sudo codesign --force --deep --sign - /path/to/application.app

“{Application Name} was unable to find a valid jvm”

  1. Open {Application Name}.app/Contents/info.plist with Xcode
  2. Make JVMVersion correct for installed JVM version
...
<key>JVMOptions</key>
<dict>
  <key>JVMVersion</key>
  <string>1.8*</string>
...

Windows

How to enable natural scrolling (Invert scroll directions)

In the registry key:
KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\{Your Device ID}\Device Parameters,
modify 2 properties as following:

Name Type Data
FlipFlopHScroll REG_DWORD 0x00000001 (1)
FlipFlopWheel REG_DWORD 0x00000001 (1)

You can check the device ID in Device Manager -> HID-compliant mouse properties -> Events -> Information. Maybe the ID starts with VID_... and ends with ...&0&0000 or similar.

MSYS2

Recommended Settings

Set environment variable: HOME as following.

Variable Value
HOME %USERPROFILE%

Link C:\Users with /home.

echo "C:/Users /home" >> /etc/fstab

Fix broken multibyte characters

Open ~/.minttyrc and add / overwrite the following setting.

Locale={Your Locale}
Charset=UTF-8

Recommended Packages

Name Description
curl Transfer a URL
git The stupid content tracker
git-flow Git extensions to provide high-level repository operations for Vincent Driessen's branching model (AVH edition)
man An interface to the on-line reference manuals
openssh OpenSSH SSH client (remote login program)
tar An archiving utility
tree List contents of directories in a tree-like format
wget The non-interactive network downloader
whois Client for the whois directory service
winpty-git A Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs

Babun (Cygwin)

atom & apm commands are not working

Add following lines to ~/.zshrc or ~/.bashrc.

alias atom="atom.cmd"
alias apm="apm.cmd"

My SSH key is not working

Maybe permissions issue. Try following commands.

chgrp -R Users ~/.ssh
chmod -R 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa

Some Vagrant commands are not working

Put the following line into ~/.zshrc or ~/.bashrc.

export VAGRANT_DETECTED_OS=cygwin

Or a more cross-platform version:

export VAGRANT_DETECTED_OS="$(uname)"

Cannot git fetch with some errors like fhandler_disk_file::fixup_mmap_after_fork: ...

These are caused by memory allocation error of Windows 8 x64. Follow the steps below to fix.

First, open Ash.

ash

Set default heap size of Git, Bash, Zsh to 3MB or larger.

/bin/peflags -z3072 /usr/bin/git
/bin/peflags -z3072 /bin/bash
/bin/peflags -z3072 /bin/zsh

Then, exit Ash and restart the terminal.

exit

PHP

Enable OpenSSL extension

Uncomment or add the following directives in php.ini.

extension_dir = "ext"
extension=php_openssl.dll

Git

Remove all files that have been tracked but ignored

git ls-files --ignored --exclude-standard | xargs git rm

XDebug

xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_autostart=0
xdebug.remote_connect_back=1

MySQL

Some commands are denied after upgrade

mysql_upgrade -u{USER} -p{PASSWORD}

Eclipse

Eclipse won't start

Maybe your workspace is broken. Just delete:

{Your Workspace}/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

Unfortunately, your custom perspectives are also deleted.

If this doesn't work, delete:

{Your Home Directory}/.eclipse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment