Skip to content

Instantly share code, notes, and snippets.

View jyc's full-sized avatar

jyc

View GitHub Profile
@jyc
jyc / lock
Last active December 10, 2015 02:29
#!/bin/zsh
if [[ $DESKTOP_SESSION == "KDE Plasma Workspace" ]]; then
qdbus org.kde.screensaver /ScreenSaver Lock
elif [[ $DESKTOP_SESSION == "Cinnamon" ]]; then
gnome-screensaver-command -a
else
xscreensaver-command --lock
fi
xset dpms force off
@jyc
jyc / nginx.conf
Last active December 10, 2015 02:58
# put site specific configuration in conf.d/*.conf files
user nginx nginx;
worker_processes 1;
error_log /var/log/nginx/error_log info;
events {
worker_connections 1024;
use epoll;
}
server {
listen 80;
# listen 443 ssl;
server_name _;
# ssl_certificate /etc/nginx/certs/default.pem;
# ssl_certificate_key /etc/nginx/certs/default.key;
client_max_body_size 15M;
#!/bin/sh
echo -n 225 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
echo -n 1 > /sys/devices/platform/i8042/serio1/serio2/press_to_select
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "sna"
Option "TearFree" "true"
EndSection
sensor /sys/devices/virtual/thermal/thermal_zone0/temp
(0, 0, 40)
(1, 38, 43)
(2, 41, 50)
(3, 44, 54)
(4, 51, 63)
(5, 55, 67)
(7, 61, 32767)
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
#!/bin/sh
/usr/bin/synclient TapButton2=3
/usr/bin/synclient PalmDetect=1
/usr/bin/synclient TapButton3=2
/usr/bin/synclient VertTwoFingerScroll=1
/usr/bin/synclient HorizTwoFingerScroll=1
/usr/bin/synclient CircularScrolling=0
/usr/bin/synclient TapButton1=1
SUBSYSTEM=="input", ATTR{name}=="*TrackPoint*", RUN+="/home/jonathan/bin/set-trackpoint"
#! /bin/bash
## Trackpoint settings
# When run from a udev rule, DEVPATH should be set
if [ ! -z $DEVPATH ] ; then
TPDEV=/sys/$( echo "$DEVPATH" | sed 's/\/input\/input[0-9]*//' )
else
# Otherwise just look in /sys/
TPDEV=$(find /sys/devices/platform/i8042 -name name | xargs grep -Fl