Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
### Pair a Logitech MX Anywhere 2 mouse with a Linux host. It shouldn't be this complicated.
### Credits go to James Anthony here: http://askubuntu.com/questions/741330/how-do-i-get-logitech-mx-anywhere-2-to-work-in-16-04-bluetooth-smart
DEVICE_REGEX='MX Anywhere 2'
echo 'Please put your device into pairing mode if it is not already.'
echo -n 'Waiting for device detection'

Keybase proof

I hereby claim:

  • I am anoother on github.
  • I am ahmadj (https://keybase.io/ahmadj) on keybase.
  • I have a public key ASBLB2_ckzPaBk2lNa9nG6g70dm_-G6a_mK_2LT5gYfY6Qo

To claim this, I am signing this object:

smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.15.0-rc2-vega] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: Crucial_CT1050MX300SSD4
Serial Number: 163413BB62E0
LU WWN Device Id: 5 00a075 113bb62e0
Firmware Version: M0CR031
User Capacity: 1,050,214,588,416 bytes [1.05 TB]
Sector Size: 512 bytes logical/physical
nixpkgs.config = {
# Git cryptsetup for to get integritysetup
packageOverrides = pkgs: {
cryptsetup = pkgs.cryptsetup.overrideAttrs (oldAttrs: rec {
src = pkgs.fetchgit {
url = "https://gitlab.com/cryptsetup/cryptsetup.git";
branchName = "master";
};
nativeBuildInputs = with pkgs; [ autoreconfHook pkgconfig ];
buildInputs = with pkgs; oldAttrs.buildInputs ++ [ libgcrypt json_c ];
@anoother
anoother / .xsession
Created April 2, 2017 15:07
Automatically enable Freesync on Linux
#!/bin/bash
## Enable freesync - put this in eg. your .xsession
## http://support.amd.com/en-us/kb-articles/Pages/HOW-TO-ENABLE-AMD-FREESYNC-IN-LINUX.aspx
set -u
xrandr --prop | while read line; do
if echo "$line" | grep ' connected' > /dev/null; then
monitor=$(echo $line | awk '{print $1}')