Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
hmm!

Mohammad Shahgolzadeh m2sh

🤔
hmm!
View GitHub Profile
@gaquino
gaquino / gist:87bdf0e6e852e445c0489379d3e9732a
Last active Jul 7, 2021
MacOS (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools))
View gist:87bdf0e6e852e445c0489379d3e9732a
If you are facing an error like that on new MacOS version.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
It means that you need to install XCode command line, open a Terminal and run this command:
$ xcode-select --install
Note:
If you want to download and install Command Line tools manually, it can be downloaded from: https://developer.apple.com/download/more/
View snapp-total-price.js
/**
* Open https://app.snapp.ir
* Login with your credentials
* Copy and pasting this code in developer tools console
* Waiting... :)
*/
(async function () {
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
View SnappTotalPriceCalculator.js
// # Usage
//
// Save this file and replace username and password on the last line of the file with
// your Snapp username and password then run the following commands:
//
// yarn init && yarn add request
// node SnappTotalPriceCalculator.js
//
const request = require('request');
@stefancocora
stefancocora / vpn-openconnect-connect-to-cisco-anyconnect.md
Created Sep 25, 2017
Split tunneling with openconnect - A guide on how to use openconnect to establish a vpn connection to an enterprise cisco anyconnect vpn endpoint with client side routing.
View vpn-openconnect-connect-to-cisco-anyconnect.md

Introduction

The purpose of this short howto is to show you how to:

  • use openconnect [1] to connect to an enterprise cisco anyconnect endpoint
  • whilst minimizing the amount of traffic that your route through the vpn connection

Usually VPN administrators will puth the default route to the users, so that all user traffic is routed through the vpn connection. This is to address the various security concerns around compromised user computers bridging external internet traffic into the secure VPN network.

While the VPN administrator can push routes to the clients, the client can ignore these default routes and establish client side routing so that only the required A.B.C.D/E network is routed through the VPN. All other traffic will still use the clients default route and default outbound internet connection.

@jsphpl
jsphpl / NPerGroup.php
Last active May 26, 2020 — forked from tureki/BaseModel.php
laravel-pgsql-n-related-models-per-parent-with-scopes
View NPerGroup.php
<?php
namespace App\Models\Traits;
use DB;
/**
* This trait is to work around a problem where a limit on an Eloquent
* relation by default applies to all queried models in total.
*
@PieterScheffers
PieterScheffers / docker-raspberry-pi.sh
Created May 30, 2017
Build ARM docker images for Raspberry Pi with QEMU
View docker-raspberry-pi.sh
# https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/
### Choose a base image with QEMU binary
# FROM hypriot/rpi-alpine
# FROM resin/rpi-raspbian
# FROM resin/raspberry-pi-alpine-node:slim
### Register QEMU in the build agent
docker run --rm --privileged multiarch/qemu-user-static:register --reset
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active Jul 15, 2021
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
View postman-deb.sh
#!/bin/sh
ls Postman*.tar.gz > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
fi
curlExists=$(command -v curl)
@lpimem
lpimem / aria2c.py
Last active Mar 5, 2021
Aria2 Python Client
View aria2c.py
import json
import requests
class Aria2c:
'''
Example :
client = Aria2c('localhost', '6800')
# print server version
@SilverBut
SilverBut / haproxy.cfg
Last active Jul 31, 2021
[Haproxy cfg checking Socks5] Haproxy cfg to check the Socks5 connection #tags: GFW, network, haproxy, config
View haproxy.cfg
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
View Dockerfile
FROM golang:1.7
# Set go bin which doesn't appear to be set already.
ENV GOBIN /go/bin
# build directories
RUN mkdir /app
RUN mkdir /go/src/app
ADD . /go/src/app
WORKDIR /go/src/app