Skip to content

Instantly share code, notes, and snippets.

@h4de5
h4de5 / syno_photo_share.js
Last active April 25, 2017 13:40
Synology Photostation change sort order of shared album
# File location:
# file /volume1/\@appstore/PhotoStation/photo/photo_new/syno_photo_share.js
# search for:
gShareid
# add afterwards
,sort_by:"takendate",sort_direction:"desc"
@h4de5
h4de5 / content_security_policy.php
Last active October 1, 2020 16:27
Synology Photostation add Google Analytics to shared album
<?php
// beware -- this will make you photostation less secure -- beware
// file: /volume1/\@appstore/PhotoStation/photo/cms/content_security_policy.php
// starting with Photostation 7 (PHP7) the new file to edit is:
// file: /volume1/\@appstore/PhotoStation/photo/include/content_security_policy.php
// rest is the same
// search for script-src
// add 'unsafe-inline'
@h4de5
h4de5 / sagent.sh
Last active November 30, 2017 10:06
OUTDATED - Shares the same `ssh-agent` among multiple Cygwin terminals. Source: http://superuser.com/a/141241
# THERE IS NOW A BETTER WAY TO DO THIS - SEE wsl-ssh-pageant
function sshagent_findsockets {
find /tmp -uid $(id -u) -type s -name agent.\* 2>/dev/null
}
function sshagent_testsocket {
if [ ! -x "$(which ssh-add)" ] ; then
echo "ssh-add is not available; agent testing aborted"
return 1
@h4de5
h4de5 / wsl-ssh-pageant.md
Last active October 2, 2023 13:33
Use putty's SSH key agent (pageant) from windows in WSL bash - no more "ssh-add" needed

prepare on windows cmd

see: https://github.com/benpye/wsl-ssh-pageant

mkdir workspace
cd workspace
git clone git@github.com:benpye/wsl-ssh-pageant.git
cd wsl-ssh-pageant
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /out:wsl-ssh-pageant.exe Program.cs
@h4de5
h4de5 / .gitconfig
Last active January 4, 2022 16:35
show differences that would come through git pull
[user]
name = Username
email = your@email.com
[alias]
# fetches the current branch - than does a diff between the working copy and this fetched branch.
# so you should only see the changes that would come with git pull.
diffpull=!git fetch && git diff HEAD..@{u}
# lists all branches
branchlist=!git branch --list -vva
@h4de5
h4de5 / Last.fm#Track Info.src
Last active August 8, 2018 22:53
mp3tag Last.fm source plugin
# Mp3tag (2.38 or higher) Parsing for Last.fm by h4de5
# Save it in your Mp3tag data directory,
# e.g. C:\Documents and Settings\*username*\Application Data\Mp3tag\data\sources
#
# DO NOT COPY/MODIFY AND REDISTRIBUTE THIS WITHOUT PERMISSION
#
# Get correct title, artist, album and cover data from last.fm database
#
# GET last.fm API key here: https://www.last.fm/api/account/create
#
@h4de5
h4de5 / get_rpi_ip.bat
Last active February 4, 2022 17:10
get IP from Raspberry in Network
@echo off
REM run on windows in elevated cmd line
REM clear arp cache
arp -d
REM TODO: get correct subnet
REM bruteforce through the network
for /L %%a in (1,1,254) do @start /b ping 192.168.0.%%a -w 100 -n 2 >nul
@h4de5
h4de5 / install-mongodb-wsl.sh
Last active June 19, 2020 00:47
Install mongodb v4 on WSL (windows bash)
#!/bin/bash
# make sure you are on latest wsl release (bionic)
cat /etc/*release*
# add new repositories
echo "deb [ arch=amd64,i386 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
echo "deb [ arch=amd64,i386 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.1 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.1.list
# try an update (which will fail, but reveal missing keys)
@h4de5
h4de5 / install-node-npm-wsl.sh
Created December 4, 2018 10:51
Install nodejs with npm support on WSL (Bash for windows)
#!/bin/bash
# have a look here: https://github.com/creationix/nvm
# will install it into ~/.nvm/
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# restart bash
# list available nodejs versions
nvm ls-remote
@h4de5
h4de5 / plex_update.sh
Created December 19, 2018 00:24
Manual package (plex) update on Synology
#!/bin/bash
# see infos from:
# https://www.plex.tv/media-server-downloads/
# https://downloads.plex.tv/plex-media-server/1.14.1.5488-cc260c476/PlexMediaServer-1.14.1.5488-cc260c476-x86_64.spk
# first !!
# download plex sign key: https://downloads.plex.tv/plex-keys/PlexSign.key
# install it into package manager on the DSM