Skip to content

Instantly share code, notes, and snippets.

@naodesu
naodesu / image-search-options.json
Created January 10, 2019 21:43
Setting for "image search options" browser addon.
{
"ISOFormat": 3,
"Options": [
[
1,
"SauceNAO",
"icons/saucenao.ico",
true,
true,
"https://saucenao.com/search.php",
@naodesu
naodesu / getcode.ps1
Last active October 20, 2017 11:24
Get MS SQL product key
function Get-SQLserverKey {
## function to retrieve the license key of a SQL 2008 Server.
## by Jakob Bindslet (jakob@bindslet.dk)
param ($targets = ".")
$hklm = 2147483650
$regPath = "SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\Setup"
$regValue1 = "DigitalProductId"
$regValue2 = "PatchLevel"
$regValue3 = "Edition"
Foreach ($target in $targets) {
@naodesu
naodesu / gist:205689f9edad6485dca33c29c6d012ad
Created August 9, 2017 06:47
Fast youtube with external player
OS: Debian Jessie
apt-get install firefox-esr gecko-mediaplayer xul-ext-greasemonkey
Install userscript from: https://github.com/sebaro/ViewTube
@naodesu
naodesu / resumedat_2015.rb
Last active May 23, 2022 09:53 — forked from stu43005/resumedat_2015.rb
Convert added torrents data from uTorrent (resume.dat) to qBittorrent (*.fastresume) format
# encoding: utf-8
# USE AT OWN RISK
#
# Follow this guide to install Ruby on Windows (step 1 and 2): https://forwardhq.com/support/installing-ruby-windows
# Install gems (with admin cmd prompt):
# https://rubygems.org/gems/bencode
# https://rubygems.org/gems/rest_client
#
# Edit datpath below to point to your utorrent resume.dat file
@naodesu
naodesu / README.md
Last active June 23, 2017 21:14 — forked from kawashirov/README.md
Кавашировские расширения для Google+

Кавашировские расширения для Google+

Скриншот

Распространяется по лицензии WTFPL.

Внимание! Chromium-подобные браузеры (Chrome, Vivaldi, Opera, ...) на 2016.12.22 не поддерживают необходимые для работы скрипта HTML5 контекстные меню. Для включения эксперементальной поддержки необходимо включить ContextMenu в Blink. Это можно сделать флагом запуска --enable-blink-features=ContextMenu. При этом возможны проблемы.

Для нового интерфейса. Добавляет контекстные меню:

  • (На youtube-видео) "Открыть видео на YouTube", т.к. на данный невозможно открыть видео в отдельном окне не открыв видео в текущем.
  • (На youtube-видео) ... или скопировать ☝️ ссылку
@naodesu
naodesu / crontab
Created February 10, 2017 18:32
Backup 1C repository using rdiff-backup
00 6 * * * root rdiff-backup --terminal-verbosity 0 --include-globbing-filelist /etc/rdiff-backup.repository.filter /srv/repository/ /var/lib/backup/repository/
00 6 * * * root rdiff-backup --terminal-verbosity 0 --force --remove-older-than 3M /var/lib/backup/repository/
Многие знают о проблемах с rdesktop, когда при совпадении сочетания клавиш для переключения раскладок в Линуксе и Виндусе могли вводиться неправильные символы ("ю" вместо ".", "Ж" вместо ";") (altbug #5912). Положение отчасти спасало использование raw-клавиатуры (параметр "-y"), но такое решение оказалось несовместимым с новым драйвером ввода evdev (altbug #19968, обсуждение и далее по треду).
Жизнь же с разным переключением раскладок - не в радость.
Недавно удалось найти обходной маневр для решения этой проблемы: помогает удаление из используемого keymap-файла множества определений, без которых rdesktop вполне может обойтись, оставив там только нужное.
Например, можно создать файл /usr/share/rdesktop/keymaps/en-us.fixed со следующим содержимым:
include common
map 0x409
@naodesu
naodesu / checkip
Created June 23, 2016 06:44
Check WAN IP
dig +short myip.opendns.com @resolver1.opendns.com
# from: http://unix.stackexchange.com/questions/22615/how-can-i-get-my-external-ip-address-in-bash/81699#81699
@naodesu
naodesu / 1c-unpack.sh
Created April 22, 2016 10:53
Распаковывает инсталлятор 1С вида setup1c.exe и запускает его на выполнение
#!/bin/bash
set -u -e
cleanup() {
if [ -v tmp ]; then
echo rm -rf "$tmp"
fi
}
@naodesu
naodesu / gist:397f95a4daeedf6949a1
Created October 14, 2015 06:58
youtube-dl usage example
youtube-dl -i --download-archive ~/video/youtube/index.txt -o ~/video/youtube/'%(playlist_title)s-%(playlist_id)s/%(title)s-%(id)s.%(ext)s' 'https://www.youtube.com/playlist?list=PLcgq8tMT1d0bNRcNf9EGDPyf-tSwTILqf' 'https://www.youtube.com/playlist?list=PLcgq8tMT1d0aYUmXr552GVrL6G8hd0EfL' 'https://www.youtube.com/channel/UC3swwxiALG5c0Tvom83tPGg'