Skip to content

Instantly share code, notes, and snippets.

ERU HackingGate

Block or report user

Report or block HackingGate

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@HackingGate
HackingGate / cf-dev-mode.sh
Last active Jul 2, 2019
Quickly turn on CloudFlare development mode when incident happens
View cf-dev-mode.sh
# You need jq and curl installed:
# sudo apt install jq curl -y
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # find in cloudflare account settings
zone_identifier="023e105f4ecef8ad9ca31a8372d0c353" # get zone ID via API
# Get zone ID
View testMailgunWebhook.swift
// Test Webhook
// https://app.mailgun.com/app/webhooks
// WTFPL License
import Foundation
// Postbin URL
let urlString = "http://bin.mailgun.net/d806fafc"
// Sample Parameter: signature
@HackingGate
HackingGate / restore_last_git_modified_time.sh
Last active Oct 2, 2019
Retrieve and set the last modification date of all files in a git repository. Solution for https://stackoverflow.com/a/55609950/4063462
View restore_last_git_modified_time.sh
#!/bin/sh -e
OS=${OS:-`uname`}
if [ "$OS" = 'Darwin' ]; then
get_touch_time() {
date -r ${unixtime} +'%Y%m%d%H%M.%S'
}
else
# default Linux
@HackingGate
HackingGate / .customrc.sh
Last active Mar 17, 2019
git incremental clone
View .customrc.sh
#####
alias pc4=proxychains4
#####
git_incremental_clone()
{
REPO=$1
DIR=$2
git clone --recurse-submodules $REPO $DIR --depth=1
cd $DIR
@HackingGate
HackingGate / ec2-renew-ip.sh
Last active Jun 28, 2019
AWS EC2 renew IPv4 address by stop-wait-start instance. (no Elastic IPs needed)
View ec2-renew-ip.sh
#!/bin/bash
# From AWS doc
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html
# We release your instance's public IP address when it is stopped or terminated.
# Your stopped instance receives a new public IP address when it is restarted.
PATH=$HOME/.local/bin:$PATH
instace_ids="i-1348636c" #change it
@HackingGate
HackingGate / Fastfile
Created Feb 22, 2019
A fastlane/Fastfile example: resign Electra ipas using you own Apple Developer account
View Fastfile
platform :ios do
desc "Resign Electra iOS ipa"
lane :resign_ios do
resign(
ipa: "Electra1141-1.3.2.ipa",
signing_identity: "iPhone Distribution: Luka Mirosevic (0123456789)",
provisioning_profile: "Electra_iOS.mobileprovision",
)
end
end
@HackingGate
HackingGate / set-himawari-wallpaper.sh
Last active May 6, 2019
Set himawari wallpaper shell script for macOS. (Linux & Windows not tested)
View set-himawari-wallpaper.sh
#!/bin/bash
PATH=$PATH:/usr/local/bin
echo `date`
echo "Checking himawari"
if ! type himawari > /dev/null; then
echo "Install himawari with:"
echo
echo "brew install imagemagick"
@HackingGate
HackingGate / tweet_statuses_lookup.py
Last active Nov 24, 2018
Have I retweeted or liked a tweet? Check tweet status by ids.
View tweet_statuses_lookup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tweepy, sys
#enter the corresponding information from your Twitter application:
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_KEY = ''
ACCESS_SECRET = ''
@HackingGate
HackingGate / himawari.js
Last active Oct 24, 2018
Set latest himawari earth dynamic wallpaper in every 10 minutes for macOS (ひまわり8号リアルタイム壁紙)
View himawari.js
const { exec } = require('child_process');
var glob = require("glob")
var cronTime = '*/10 * * * *';
CronJob = require('cron').CronJob;
var job = new CronJob({
cronTime: cronTime,
onTick: function() {
View ShutterSoundCanceller.swift
import MediaPlayer
class ShutterSoundCanceller {
static func playShutterInvertSound() {
if let soundURL = Bundle.main.url(forResource: "photoShutterAntiSound", withExtension: "caf") {
do {
// Play sound even in silent mode
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, mode: AVAudioSessionModeMeasurement, options: [])
} catch {
print(error)
You can’t perform that action at this time.