Skip to content

Instantly share code, notes, and snippets.

View GWuk's full-sized avatar

GWu GWuk

  • Austria
View GitHub Profile
// JS script to remove nasty paste password blockers from password elements
//
// use https://mrcoles.com/bookmarklet/ to create bookmarklet from code
//
{
var inputs = document.querySelectorAll("input[type='password']");
for (var i=0; i<inputs.length; i++) {
inputs[i].removeAttribute('onkeydown');
inputs[i].removeAttribute('onpaste');
inputs[i].removeAttribute('oncopy');
@GWuk
GWuk / zte_sms.py
Last active September 16, 2023 22:38
get list of SMS from ZTE MF831 and ask to delete per id
import requests
import json
import base64
url = 'http://192.168.0.1/goform/goform_get_cmd_process?isTest=false&cmd=sms_data_total&page=0&data_per_page=500&mem_store=1&tags=10&order_by=order+by+id+desc'
s = requests.Session()
s.headers.update({'Host': '192.168.0.1'})
s.headers.update({'Referer': 'http://192.168.0.1/index.html'})
r = s.get(url)
@GWuk
GWuk / getFujiImages.ps1
Created August 28, 2016 18:05
copy image and movie files from SD card to separate directories for jpg and raw (raf)
# for direct start: exec powershell command "Set-ExecutionPolicy Unrestricted" once in elevated prompt
# store variables used before to clean up afterwards (https://blogs.technet.microsoft.com/heyscriptingguy/2011/08/21/clean-up-your-powershell-environment-by-tracking-variable-use/)
$startupVariables=""
new-variable -force -name startupVariables -value ( Get-Variable | % { $_.Name } )
$destname = 'C:\Temp\FujiStage\'
$destnameRAW = 'C:\Temp\FujiStageRAW\'
$maxfile = "$destname\max.txt"
@GWuk
GWuk / getMTPImages.ps1
Last active June 19, 2016 08:46
copy new image+video files from Fuji X-T10 to local staging directories, either from mtp or sd card
# for direct start: exec powershell command "Set-ExecutionPolicy Unrestricted" once in elevated prompt
# store variables used before to clean up afterwards (https://blogs.technet.microsoft.com/heyscriptingguy/2011/08/21/clean-up-your-powershell-environment-by-tracking-variable-use/)
$startupVariables=""
new-variable -force -name startupVariables -value ( Get-Variable | % { $_.Name } )
# https://blogs.technet.microsoft.com/jamesone/2009/09/23/on-scanners-cameras-and-their-usb-modes-and-lifting-the-lid-on-how-they-can-be-scripted/
#$WIAdialog = New-Object -ComObject "WIA.CommonDialog"
@GWuk
GWuk / win7_ntp.cmd
Last active January 26, 2016 06:56
:: ----------------------------------------------------------------------------
:: setup Win7 NTP time sync
:: ----------------------------------------------------------------------------
:: general info: http://blogs.technet.com/b/askds/archive/2007/11/01/configuring-your-pdce-with-alternate-time-sources.aspx
:: stop service and reset
net stop w32time
:: reset (avoids problems)
w32tm /unregister
@GWuk
GWuk / DontEatYellowSnow.js
Created December 31, 2015 19:23
Greasemonkey script - entfernt den gelben Balken in den derstandard.at Kommentaren
// ==UserScript==
// @name Don't eat yellow snow
// @namespace GWu
// @description entfernt den gelben Balken in den derstandard.at Kommentaren
// @author GWu
// @include http://d*standard.at/*
// @include https://d*standard.at/*
// @run-at document-start
// @grant GM_addStyle
// ==/UserScript==
@GWuk
GWuk / ec2_debian8_small.sh
Last active December 21, 2015 21:05
how to reduce AWS EC2 AMI volume size for Debian Jessie
# -----------------------------------------------------------------------------
# set of commands to reduce AWS EC2 AMI volume size for Debian Jessie
# tested on debian-jessie-amd64-hvm-2015-06-07-12-27-ebs (ami-e31a6594)
#
# !! DO NOT EXECUTE as script, think before you type and hit ENTER !!
#
# -----------------------------------------------------------------------------
# Copyright (c) 2015 GWu
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@GWuk
GWuk / ec2_debian7_small.sh
Last active December 21, 2015 21:06
how to reduce AWS EC2 AMI volume size for Debian Wheezy
# -----------------------------------------------------------------------------
# set of commands to reduce AWS EC2 AMI volume size for Debian Wheezy
# tested on debian-wheezy-amd64-hvm-2015-01-28-ebs (ami-61e56916)
#
# !! DO NOT EXECUTE as script, think before you type and hit ENTER !!
#
# -----------------------------------------------------------------------------
# Copyright (c) 2015 GWu
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@GWuk
GWuk / s3sync_v2.rb
Last active December 26, 2015 21:16 — forked from bantic/bucket_sync_service.rb
ruby class to copy from one aws s3 bucket to another - using aws-sdk Version 2
#!/usr/bin/env ruby
require 'aws-sdk' # gem name is 'aws-sdk', uses Version 2
class BucketSyncService
attr_reader :from_bucket, :to_bucket, :logger, :path, :etag
attr_accessor :debug
# from_credentials and to_credentials are both hashes with these keys:
# * :aws_access_key_id