Skip to content

Instantly share code, notes, and snippets.

View michfield's full-sized avatar

Michael Field michfield

View GitHub Profile
@michfield
michfield / *.md
Created May 21, 2013 07:44
Logitech Back & Forward buttons on Linux

Find out which mouse button is which with:

xev | grep -i button

On my mouse, 6 and 7 are Back and Forward buttons.

Then add this lines ~/.xbindkeysrc

## Logitech mouse Back and Forward
@michfield
michfield / *.md
Last active December 17, 2015 13:09
Disable `Alt+F1` in Linux Mint

Disable Alt+F1, Alt-F7, etc, because I need them in Double Commander as shortcuts. Read more: http://askubuntu.com/questions/126817/how-to-disable-alt-f1-alt-f2-shortcuts

gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "[]"
gsettings set org.gnome.desktop.wm.keybindings begin-move "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down  "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "[]"

This should be executed only once. It's remembered forever.

@michfield
michfield / mysql56-install.sh
Created May 14, 2013 19:26
Shell script to install MySQL 5.6.11 on Ubuntu Raring Ringtail 13.04 x64
#!/usr/bin/env bash
#
# Install MySQL server
#
# Author:
# Colovic Vladan, First Beat Media
#
download_dir=/srv/tmp/download
download_url=https://dl.dropbox.com/u/191471/FirstBeatMedia/mysql-5.6.11-debian6.0-x86_64.deb
@michfield
michfield / .md
Last active December 16, 2015 16:19

Using variables, also called repeated nodes in YAML, but in JSON variant of YAML format. I'm using this for the whole subtree. Great!

{
  "original": &VAR
  {
    "x": "Value x",
    "subtree":
    {
      "y": "Value Y"

Recursively convert text files from DOS to Unix line-endings
Type in Windows command line:

for /r "miscellaneous" %x in ("*") do @dos2unix --d2u --verbose --skipbin "%x"

@michfield
michfield / *.md
Last active December 16, 2015 15:19
How to change Start menu button keyboard shortcut in Linux Mint?

Linux Mint has something called MintMenu button that has a functionality similar to the Start button in Windows.

To define keyboart shortcut for this button, we need to right-click on the MintMenu button on the panel and from the dropdown to click on Preferences. Change the keyboard shortcut there.

Log out and back in, to see effects of changes made.

@michfield
michfield / *.md
Last active December 12, 2015 01:38
Fix Vagrant about environment variables #vagrant

Batch file vagrant.bat sets both GEM_HOME and GEM_PATH environment variables. It would be nice of him to restore old values after finishing it's work.

Something like:

:: Save variables
SET "GEM_HOME_SAVED=%GEM_HOME%"
SET "GEM_PATH_SAVED=%GEM_PATH%"
@michfield
michfield / *.bat
Last active September 11, 2017 14:38
Install Gems without documentation #ruby #windows
:: Make --no-ri --no-rdoc default gem install options (without documentation)
:: Possible variations:
:: For every user:
:: echo gem: --no-ri --no-rdoc > "%PROGRAMDATA%\gemrc"
:: Only for you
:: echo gem: --no-ri --no-rdoc >> "%USERPROFILE%\.gemrc"
::
:: Note: In Windows, %PROGRAMDATA% is /etc on Linux
::
:: But finally, the best way to do it. See: http://stackoverflow.com/a/7662245/1579985
@michfield
michfield / *.bat
Last active October 1, 2019 03:11
The only way to install ZeroMQ in Windows
:: Download ZeroMQ for Windows [Installers for Microsoft Windows](http://www.zeromq.org/distro:microsoft-windows)
:: Use only 32bit install, even on 64bit Windows and only 2.2.0 version (not 3.x)
:: Make sure you're not using the 3.x beta version of zeromq - you must use the official 2.x libs
ZeroMQ-<whatever>.exe /S /D=c:\tools\zeromq && echo ZeroMQ for Windows installed
:: DLL must be renamed
copy c:\tools\zeromq\bin\libzmq-v100-mt.dll c:\tools\zeromq\bin\libzmq.dll
:: Install Ruby Gem zmq
@michfield
michfield / gist:4525251
Last active July 25, 2021 05:41
Clone all GitHub repositories of a user #bash