Skip to content

Instantly share code, notes, and snippets.

View information-security's full-sized avatar

Farzan information-security

  • YouTob Telecom
  • Iran
View GitHub Profile
@information-security
information-security / vscode-extension-offline.md
Created April 27, 2024 11:10 — forked from wanglf/vscode-extension-offline.md
Download VS Code extensions as VSIX

How to use?

  • Copy content of vsix-bookmarklet, create a bookmark in your browser.
  • Navigate to the web page of the VS Code extension you want to install.
  • Click the bookmark you just created, then click the download button.
    download
  • After download finished, rename the file extension to *.vsix.
  • In VS Code, select Install from VSIX... in the extension context menu.
    vsc
@information-security
information-security / Readme.md
Created November 4, 2022 08:18
Route traffic of multiple IPs through secondary gateway (e.g. ppp connections) on Ubuntu 22

Assumption

We assume that a VPN connection is already setup and a ppp0 interface is up and running.

Routing modifications

Run following commands as root user:

cd /etc/iproute2
cp rt_tables rt_tables.orig

echo "1 vpn" >> /etc/iproute2/rt_tables
@information-security
information-security / install.md
Created November 4, 2022 03:37
Install sstp-client on ubuntu 22

Prerequisites

sudo apt-get install build-essential ppp-dev libevent-dev libssl-dev autoconf libtool

Clone the repo

git clone https://gitlab.com/eivnaes/sstp-client.git sstp-client-source
cd sstp-client-source
@information-security
information-security / callee.yml
Created January 10, 2022 00:47
How to trigger a GitHub workflow/action of another repository
name: Dispatch receiver
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
# Allows you receive the dispatch
workflow_dispatch:
@information-security
information-security / ci.yml
Created August 21, 2021 06:38
Prevent Github actions from running a workflow when commit message starts with WIP:
name: CI Workflow
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
jobs:
build:
runs-on: self-hosted
if: "! startsWith(github.event.head_commit.message, 'WIP:')"
@information-security
information-security / safari_redux_devtools.txt
Created August 10, 2021 16:19
How to access redux store on Safari
Tested with Safari Version 12.1 (14607.1.40.1.4), running following line in Safari's console did the trick for me:
document.getElementById('root')['_reactRootContainer']
._internalRoot.current.child.memoizedProps
.children.props.store.getState()
A related StackOverflow post:
https://stackoverflow.com/questions/59584733/how-do-i-access-the-redux-store-in-safari/68730213#68730213
@information-security
information-security / install_powershell_ubuntu.sh
Last active September 27, 2021 00:45
How to restart RDP windows service remotely (TermService)
# Install PowerShell
sudo snap install powershell --classic
# Or refer to following official link for further options. (I followed installation via package repository for Ubuntu 20.04)
# https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#installation-via-package-repository---ubuntu-2004
# install NTLM dependency
sudo apt install gss-ntlmssp
# Start PowerShell
sudo pwsh
@information-security
information-security / rbash.sh
Created July 7, 2021 00:24
Create limited user in linux
#!/bin/bash
commands=("man" "pwd" "ls" "whoami" "df" "top")
timestamp(){ date +'%Y-%m-%s %H:%M:%S'; }
log(){ echo -e "$(timestamp)\t$1\t$(whoami)\t$2" > /var/log/rbash.log; }
trycmd()
{
# Provide an option to exit the shell
if [[ "$ln" == "exit" ]] || [[ "$ln" == "q" ]]
then
@information-security
information-security / fake_webcam_stream.bat
Last active October 9, 2023 16:51
Fake webcam & audio streams for Google Chrome on Windows
:: With custom video file
./chrome.exe --use-fake-device-for-media-stream --use-file-for-fake-video-capture=c:\akiyo_qcif.y4m --user-data-dir=C:\tmp
:: With default stream
./chrome.exe --use-fake-device-for-media-stream --user-data-dir=C:\tmp2
@information-security
information-security / fixIOSAudioContext.js
Created May 6, 2021 01:02 — forked from kus/fixIOSAudioContext.js
Fix iOS AudioContext on Safari not playing any audio. It needs to be "warmed up" from a user interaction, then you can play audio with it as normal throughout the rest of the life cycle of the page.
// Fix iOS Audio Context by Blake Kus https://gist.github.com/kus/3f01d60569eeadefe3a1
// MIT license
(function() {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
if (window.AudioContext) {
window.audioContext = new window.AudioContext();
}
var fixAudioContext = function (e) {
if (window.audioContext) {
// Create empty buffer