Skip to content

Instantly share code, notes, and snippets.

View magicdude4eva's full-sized avatar

Gerd Naschenweng magicdude4eva

View GitHub Profile
@magicdude4eva
magicdude4eva / Huawei.php
Created April 14, 2019 10:54
Huawei B618s-22d - reboot script and retrieval of other info
View Huawei.php
<?php
// Config
$routerAddress = '192.168.8.1';
$username="admin";
$password="password";
// Code
$router = new HuaweiB618($routerAddress);
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active September 26, 2023 23:01
zsh-syntax-highlighting paste performance improvement
View zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@magicdude4eva
magicdude4eva / dnstest.sh
Last active March 12, 2023 12:01
Dnstest
View dnstest.sh
#!/usr/bin/env bash
command -v bc > /dev/null || { echo "bc was not found. Please install bc."; exit 1; }
{ command -v drill > /dev/null && dig=drill; } || { command -v dig > /dev/null && dig=dig; } || { echo "dig was not found. Please install dnsutils."; exit 1; }
NAMESERVERS=`cat /etc/resolv.conf | grep ^nameserver | cut -d " " -f 2 | sed 's/\(.*\)/&#&/'`
PROVIDERS="
1.1.1.1#cloudflare
4.2.2.1#level3
@magicdude4eva
magicdude4eva / logstash.conf
Created March 13, 2017 12:48
Port25 / PowertMTA Logstash / Graylog configuration
View logstash.conf
################################################################################
## Port25 Logstash configuration
##
## Logging configuration:
##
## <acct-file /var/log/pmta/acct.csv>
## delete-after 60d
## move-interval 5m
## max-size 500M
## records d,b,r,t,tq,f,rb,rs
@magicdude4eva
magicdude4eva / bidorbuy-test.md
Last active November 27, 2021 11:45
Bidorbuy Java test
View bidorbuy-test.md

Programming example - Write an app:

  • For Java tests create a Tomcat/Webapp project using Eclipse and then write a simple search/display results app using JSPs.
  • For Android / iOS native apps use the respective development IDEs (Android Studio or XCode)
  • Email back the completed project (it should be importable into the IDE and just run)
  • There is no limit to creativity/what you use. The code should however follow a MVC pattern and have abstraction/separation of concerns (i.e. network logic should not be part of presentation logic)

The service to call for this exercise is the Paginated Trade Search service. It is a RESTful GET service you will call with HTTP parameters to retrieve the results you want. For authentication to the service you will add HTTP headers to your request.

First things first, each call you make to our demo service requires the following HTTP headers:

@magicdude4eva
magicdude4eva / FileDownload.java
Created June 8, 2017 19:05
How to bypass SSLProtocolException: handshake alert: unrecognized_name
View FileDownload.java
/** Downloads a file from the specified URL to the specified local file path.
* It returns the number of bytes in the downloaded file,
* or throws an exception if there is an error.
*
* @param aURL
* @param aLocalFilePath
* @param aMilliSecondTimeout
* @param aSkipSNI
* @return
*/
@magicdude4eva
magicdude4eva / dyn_dns_acme.sh
Created July 5, 2017 15:55
dyn_dns_acme.sh
View dyn_dns_acme.sh
#!/usr/bin/bash
#DynDNS.com Domain API
CUSTOMERNAME='PLEASE-SET'
USERNAME='PLEASE-SET'
PASSWORD='PLEASE-SET'
DYNAPIURL="https://api.dynect.net/"
ZONE="PLEASE-SET"
View keybase.md

Keybase proof

I hereby claim:

  • I am magicdude4eva on github.
  • I am gerdnaschenweng (https://keybase.io/gerdnaschenweng) on keybase.
  • I have a public key whose fingerprint is 891E 002F B39A 48FF F0CD B42D 46A2 E460 224C 2557

To claim this, I am signing this object:

@magicdude4eva
magicdude4eva / destiny-nightfall-inverted-spire
Created September 14, 2017 15:55
Nightfall - Inverted Spire tips
View destiny-nightfall-inverted-spire
Strategy for inverted spire Nightfall:
- IMPORTANT: Make sure that your fire-team have arc, solar and void weapons
- Sparrow to first section and drop void grenade on minotaur (it's always void)
- Kill ads and it will probably flip to arc
- Open platforms and loop through next section
- Kill some ads, take loop
- Next section: DO NOT JUMP THROUGH LOOP. Take out ads first. Then jump through all loops
- You should have about 8min on the clock again
- Skip next section and sparrow to right boss. Take him out
- Go over to left section, take out boss.
@magicdude4eva
magicdude4eva / better-touch-bar-crypto.json
Last active November 27, 2021 11:44
Better-Touch-Bar Config for Crypto currencies - BTC / Ether / Ripple
View better-touch-bar-crypto.json
{
"BTTPresetName" : "CryptoCurrency",
"BTTPresetUUID" : "3A49CBCE-DE02-4F8F-A70E-6BA367ACD683",
"BTTPresetContent" : [
{
"BTTAppBundleIdentifier" : "BT.G",
"BTTAppName" : "Global",
"BTTAppSpecificSettings" : {
},