Skip to content

Instantly share code, notes, and snippets.

View lewixlabs's full-sized avatar

Luigino De Togni lewixlabs

View GitHub Profile
@lewixlabs
lewixlabs / OAuth2Custom.cs
Last active November 19, 2018 15:18
Xamarin OAuth2 Custom Class to get & use refresh_token
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Auth;
namespace MyNetStandardLibrary.OAuth2
{
// inspired by https://lostechies.com/jimmybogard/2014/11/13/mobile-authentication-with-xamarin-auth-and-refresh-tokens/
public class CustomOAuth2Authenticator : OAuth2Authenticator
{
@lewixlabs
lewixlabs / git-clearHistory
Created July 23, 2019 11:21 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git
@lewixlabs
lewixlabs / install_go_pi.sh
Created August 30, 2019 10:24 — forked from pcgeek86/install_go_pi.sh
Install Go Lang 1.11.1 on Raspberry Pi 3 B+
cd $HOME
FileName='go1.11.1.linux-armv6l.tar.gz'
wget https://dl.google.com/go/$FileName
sudo tar -C /usr/local -xvf $FileName
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
@lewixlabs
lewixlabs / tscard-esample.ts
Last active February 2, 2021 10:23
TsCard Example
// example for typescript library TsCard
// https://github.com/lewixlabs/TsCard
// command to use:
// tsc --target ES5 example.ts
import { TsCard } from './index';
import Reader, { ApduResponse } from './reader';
import SmartCard from './cards/smartcard';
import { Sle } from './cards/memorycard';
import Utilities from './utilities';
@lewixlabs
lewixlabs / txpower.sh
Last active July 6, 2020 10:05
Simple script to set a wifi card in monitor mode with tx power to 30dBm
#!/bin/bash
# credits: https://miloserdov.org/?p=337
# example_
# ./txpower.sh wlan0
sudo iw reg set BZ
sudo ip link set $1 down
sudo iw dev $1 set txpower fixed 30mBm
sudo iw $1 set monitor control
sudo ip link set $1 up
sudo iw dev
@lewixlabs
lewixlabs / TL-WN722N_monitormode.sh
Last active June 15, 2024 14:50
How to enable monitor mode for TP-LINK TL-WN722N V2/V3/Vx
# Credits:
# - https://www.hackster.io/thatiotguy/enable-monitor-mode-in-tp-link-tl-wn722n-v2-v3-128fc6
# - https://github.com/aircrack-ng/rtl8188eus/issues/234
# Tested on Kali Linux 2022.3
# Commands used to Setup the Adapter from aircrack repository
sudo apt update
sudo apt install bc -y
sudo rmmod r8188eu.ko
git clone https://github.com/gglluukk/rtl8188eus
cd rtl8188eus