;// This is the "back" button ... ;// Keywait waits max 210ms for key release. ;// IF: (keywait < 200ms) -> send the actual button, IF: (keywait > 200ms (or timeout)) -> send key PageUp. XButton1:: x:=A_TickCount Keywait XButton1, T0.21 d:=(A_TickCount-x) If (d<200) Send {XButton1} Else Send {PgUp} Return ;// This is the "forward"-button ... ;// Keywait waits max 210ms for key release. ;// IF: (keywait < 200ms) -> send the actual button, IF: (keywait > 200ms (or timeout)) -> press the 1-button down, repeat. XButton2:: x:=A_TickCount Keywait XButton2, T0.21 d:=(A_TickCount-x) If (d<200) Send {Xbutton2} Else Send {1 Down} Return ;// When "forward" is released, the 1-button is released ... XButton2 Up:: Send {1 Up} Return
fluff
It's fluff, all the way down.
Labels
- linux (21)
- script (15)
- css (12)
- bash (9)
- cli (9)
- customize (8)
- stylish (7)
- windows (6)
- firefox (5)
- userchrome.css (5)
- xbmc (5)
- ahk (3)
- autohotkey (3)
- command line (3)
- tt-rss (3)
- ubuntu (3)
- SQL (2)
- automation (2)
- batch (2)
- config (2)
- google reader (2)
- javascript (2)
- mpd (2)
- photos (2)
- spotify (2)
- virtualbox (2)
- API (1)
- GW2 (1)
- Guild Wars 2 (1)
- SQL Server (1)
- android (1)
- animals (1)
- arch linux (1)
- backup (1)
- bukkit (1)
- c# (1)
- cross browser (1)
- curl (1)
- debian (1)
- deluge (1)
- ext.net (1)
- facebook (1)
- flexget (1)
- flowers (1)
- gentoo (1)
- greasemonkey (1)
- kodi (1)
- openbox (1)
- pidgin (1)
- python (1)
- raspberry (1)
- rpi (1)
- scriptish (1)
- tasker (1)
- tellstick (1)
- tmux (1)
- update (1)
- video (1)
- youtube (1)
Wednesday, May 12, 2021
Autohotkey, mouse button different action, click vs hold
Friday, May 24, 2019
Youtube video pop-out with autoplay and in HD!
I like to have the youtubes in a little popped out window next to my main browser in order to keep it visible when doing other stuff.
This greesemonkey/scriptish script replaces all the video links on the youtube site with a javacript window.open call which, predictably opens a new window with the video in it.
This greesemonkey/scriptish script replaces all the video links on the youtube site with a javacript window.open call which, predictably opens a new window with the video in it.
Saturday, November 24, 2018
"Keep WiFi on during sleep" from adb
adb shell settings put global wifi_sleep_policy 2
* Always = 2
* Only When Plugged In = 1
* Never = 0
Sunday, October 14, 2018
Backup running VirtualBox machine (with only a tiny interupt)!
There is a lot to be said about backups. I won't even try to cover all bases. I'll just show you what I'm using, that works for me. Yes.
In a nutshel this is what happens
Input is name of VM-machine and index of backup.
Output is a backup of your machine ... who'da thunk it.
The usage of rsync is mostly cause of access to --progress but this could be substituted for simple "cp" or similar.
Update 1: Now using --live switch for the snapshot command. Without it one guest with USB attached kept getting Aborted when snapshot was taken. With --live it's working again.
Update 2: The --live switch was not the issue :(. Apparently snapshots does not work with anything lower than the USB 3.0 controller. This controller does however lose the attached devices when you snapshot the guest instead. Bah. Workaround is a detach and re-attach of the device to the affected guest. In my case this is not a problem but if you are attaching a disk drive or something that the guest is using constantly this might lead to bad stuff. Take care.
Update 3: So the UUID changes with every boot and every physical reattach of the device, how very practical. Well, let's fix that.
That's it. It works for me, ymmw. :)
In a nutshel this is what happens
- some sanity checks and destination creation.
- copy xml-config for chosen VM.
- create snapshot for chosen VM so that original vdi-file is released.
- will pause running VM for 1-2s.
There is a --live switch for the snapshot command but I have not tested this. - copy original vdi-file to backup destination.
- remove snapshot thus "merging" the changes back into the running vdi.
- ???
- profit!
Input is name of VM-machine and index of backup.
Output is a backup of your machine ... who'da thunk it.
The usage of rsync is mostly cause of access to --progress but this could be substituted for simple "cp" or similar.
Update 1: Now using --live switch for the snapshot command. Without it one guest with USB attached kept getting Aborted when snapshot was taken. With --live it's working again.
Update 2: The --live switch was not the issue :(. Apparently snapshots does not work with anything lower than the USB 3.0 controller. This controller does however lose the attached devices when you snapshot the guest instead. Bah. Workaround is a detach and re-attach of the device to the affected guest. In my case this is not a problem but if you are attaching a disk drive or something that the guest is using constantly this might lead to bad stuff. Take care.
Update 3: So the UUID changes with every boot and every physical reattach of the device, how very practical. Well, let's fix that.
That's it. It works for me, ymmw. :)
Tuesday, May 29, 2018
Create random Spotify playlist with bash, curl and the Spotify API
Untinkered with this script will
You need a access-token with enough permissions (scopes) to modify playlists. I created one with AAAALL the scopes for my personal use so I'm not entirely sure which ones are really needed.
On to the script ...
- add 140 random songs from the source-playlist(s) to the destination-playlist
- keep track of added files
- keep artist-separation at 50 songs (some songs "featuring" other artists might slip through)
- filter out titles with "bad" words, "live in", "live at", "remix", "shitty version" ... etc.
- filter out artists
- filter out songs by id
You need a access-token with enough permissions (scopes) to modify playlists. I created one with AAAALL the scopes for my personal use so I'm not entirely sure which ones are really needed.
On to the script ...
Sunday, October 30, 2016
Kodi addon, run script on playback action
Addon version of a kodi-script I never published here ... so yeah.
Run scripts when you start playing a video in kodi. In my case I turn off some HUE-lights on play and turn them on, in red, on pause.
2021-03-14: Made this a bit less shit, maybe. Added some debug-logging. Also in a sort of "auto-like" for youtube-videos, very hacky.
Run scripts when you start playing a video in kodi. In my case I turn off some HUE-lights on play and turn them on, in red, on pause.
2021-03-14: Made this a bit less shit, maybe. Added some debug-logging. Also in a sort of "auto-like" for youtube-videos, very hacky.
Monday, June 27, 2016
Spotify: Remove Recommended Songs in playlists
1. Navigate to: %userprofile%\AppData\Roaming\Spotify\Apps
2. Rename the file playlist-desktop.spa to .zip and extract it to .\playlist-desktop then rename it to .bak.
3. Edit .\playlist-desktop\css\style.css and change the rule for .playlist-extender-content to the following:
2. Rename the file playlist-desktop.spa to .zip and extract it to .\playlist-desktop then rename it to .bak.
3. Edit .\playlist-desktop\css\style.css and change the rule for .playlist-extender-content to the following:
.playlist-extender-content { display: none !important; margin-top: 60px; margin-bottom: 16px; }4. Restart/start Spotify and enjoy a Recommendation-free experience. \o/
Saturday, February 27, 2016
Firefox - userchrome.css, the 1px border-annoyance ...
At the bottom of the navigation pane at the top of the firefox window, there's a colored border. This border is not in fact, as one probably would guess, a border at all. It's an ::after-thingy with a height of 1 pixel. I don't know the reasoning behind this but I gonna call it stupid regardless. And if not stupid, at least unnecessary and unusual. Borders do their job, why complicate it?!
Ah well, it's gone now ...
Ah well, it's gone now ...
#navigator-toolbox::after { /* srslyfuckyoumoz */ height: 0; }
Saturday, May 16, 2015
Home "automation" in Linux with netcat/socat
I realize that this post i lacking in instructions. I might flesh this out at a later date but no guaranties. It's not really that difficult once you figure out my madness ;)
I'm using tasker and udp sender to send udp packets with commands to a listening socat.
So if I send, for example (trailing blank line is intentional):
On to the script.
I'm using tasker and udp sender to send udp packets with commands to a listening socat.
So if I send, for example (trailing blank line is intentional):
hue_onmy Hue lights and HTPC will turn on. Tasker is then set up to send these commands when my phone connects to my home network. Simple and effective.
kodi_on
On to the script.
Saturday, April 25, 2015
Monitor/screen standby on Raspberry Pi 2
These instructions are kind of hastily thrown together so you might want to research this on your own a bit more and not simply copy-paste this.
We will use xscreensaver (from the repos) and tvservice - which is (apparently) preinstalled in /opt/vc/bin/tvservice - to control the video output and turn the connected monitor on and off.
Subscribe to:
Posts (Atom)