Sunday, March 26, 2017

sqllite commandline history via up/down keys

I found very annoying problem with sqlite CLI. When you press up/down arrow keys, it prints ASCI characters of the keys rather that showing historical commands. When I googled, I realised that we can either link readline library when compiling sqlite or do:
sudo apt-get install rlwraprlwrap sqlite3 database.db
worked like a charm for me.

Saturday, March 18, 2017

increasing brightness on LXDE display on lubunut

LXDE seems to have 2 brightness controls. Both of them are found in locations: /sys/class/backlight/

For me it was :

harsshal@dell:~$ ll /sys/class/backlight/ 
lrwxrwxrwx  1 root root 0 Mar 18 12:58 acpi_video0 -> ../../devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/lrwxrwxrwx  1 root root 0 Mar 18 12:58 intel_backlight -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/


Both locations have max_brightness file :

harsshal@dell:~$ ll /sys/class/backlight/*/max_brightness -r--r--r-- 1 root root 4096 Mar 18 12:58 /sys/class/backlight/acpi_video0/max_brightness-r--r--r-- 1 root root 4096 Mar 18 12:58 /sys/class/backlight/intel_backlight/max_brightness

harsshal@dell:~$ cat /sys/class/backlight/*/max_brightness 7255000
So typically intel_backlight will be controlled by all your default brightness controller, but acpi_video0 will need manual changes when you need to change it:
harsshal@dell:~$ echo 7 | sudo tee /sys/class/backlight/acpi_video0/brightness 7
Other methods of increasing brightness :

harsshal@dell:~$ xbacklight -set 60
Or

harsshal@dell:~$ xrandr -q | grep -w connectedLVDS-1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 290mm x 180mmharsshal@dell:~$ xrandr --output LVDS-1 --brightness 1

Wednesday, March 1, 2017

startup scripts in windows to keep screen active

I wrote a script to keep my comupter not get locked. script goes as follows:
set WshShell = WScript.CreateObject("WScript.Shell")

x = 1

do while x = 1 'Loop forever and ever and ever and ever

WshShell.SendKeys "%^" 'SEND CTL + ALT

WScript.Sleep 290000 '<5 MINS

loop

I placed this script at location C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
and no more locking up the screen....