Skip to content

Instantly share code, notes, and snippets.

View magicdude4eva's full-sized avatar

Gerd Naschenweng magicdude4eva

View GitHub Profile
@magicdude4eva
magicdude4eva / dnstest.sh
Last active March 12, 2023 12:01
Dnstest
#!/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 / Huawei.php
Created April 14, 2019 10:54
Huawei B618s-22d - reboot script and retrieval of other info
<?php
// Config
$routerAddress = '192.168.8.1';
$username="admin";
$password="password";
// Code
$router = new HuaweiB618($routerAddress);
import java.util.*;
public class MemEat {
public static void main(String[] args) {
List l = new ArrayList<>();
System.out.println("Max Java Memory (MB): " + Runtime.getRuntime().maxMemory() / (1_024 * 1_024));
System.out.println("Total Memory (MB): " + Runtime.getRuntime().totalMemory() / (1_024 * 1_024));
System.out.println("Max Java CPU Cores: " + Runtime.getRuntime().availableProcessors());
while (true) {
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active November 29, 2024 15:02
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 / smtp-test.php
Created February 1, 2019 09:59
SMTP Test via PHPMailer
<?php
/*
To test: Run on any version of PHP, then install "PHPMailer" via composer:
composer require phpmailer/phpmailer
Test login via: https://outlook.office365.com/ecp/
*/
$fromAddress = 'XXX@domain.com';
$recipientAddress = 'YYY@recipientdomain.com';
@magicdude4eva
magicdude4eva / proxy.php
Created January 25, 2018 17:45
proxyrotator
<?php
// Get API key from https://www.proxyrotator.com/
$url = 'http://venus.proxyrotator.com/?apiKey=' . $apikey;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$response = curl_exec($ch);
curl_close($ch);
@magicdude4eva
magicdude4eva / TERMS-AND-CONDITIONS
Last active November 27, 2021 11:44
MD4ECryptoBot - Terms and Conditions
## MD4ECryptoBot - https://twitter.com/MD4ECryptoBot
The bot is a private trading bot, trading on various crypto-exchanges. The bot trades in realtime
and publishes BUY/SELL orders on various platforums such as Twitter.
NONE OF THOSE MESSAGES ARE FINANCIAL ADVICE AND TRADING BASED ON THOSE MESSAGES MIGHT INCUR LOSSES.
## What is Cryptocurrency ?
Is a digital asset which is designed to act as a medium of exchange that uses encryption to secure transactions
and control the creation of new currency units. Cryptocoins are a subset of digital coins.
@magicdude4eva
magicdude4eva / binance-notifi.php
Last active November 27, 2021 11:44
Binance PushBullet integration via Websocket
<?php
/*
Uses the API as from https://github.com/binance-exchange/php-binance-api
Uses Pushbullet API from https://github.com/ivkos/Pushbullet-for-PHP
Install:
1) curl -s http://getcomposer.org/installer | php
2) php composer.phar require "jaggedsoft/php-binance-api @dev" "ivkos/pushbullet @dev"
@magicdude4eva
magicdude4eva / better-touch-bar-crypto.json
Last active March 6, 2024 19:27
Better-Touch-Bar Config for Crypto currencies - BTC / Ether / Ripple
{
"BTTPresetName" : "CryptoCurrency",
"BTTPresetUUID" : "3A49CBCE-DE02-4F8F-A70E-6BA367ACD683",
"BTTPresetContent" : [
{
"BTTAppBundleIdentifier" : "BT.G",
"BTTAppName" : "Global",
"BTTAppSpecificSettings" : {
},
@magicdude4eva
magicdude4eva / destiny-nightfall-inverted-spire
Created September 14, 2017 15:55
Nightfall - Inverted Spire tips
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.