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 / convert_slin2wav.sh
Created August 20, 2015 14:09
Yate's slin format and Asterisk's sln format can be converted to wav files using this cmd. Usage: convert_slin2wav.sh in.slin out.wav
# Usage: convert_slin2wav.sh in.slin out.wav
sox -t raw -r 8000 -b 8 -c 1 --bits 16 --encoding signed-integer --endian little $1 $2
@information-security
information-security / CSVEnclosedColumns.vba
Created May 2, 2016 22:13
A macro to save a unicode CSV file in excel having all columns enclosed with quotation marks.
Sub QuoteCommaExport()
' Dimension all variables.
Dim DestFile As String
Dim ColumnCount As Integer
Dim RowCount As Integer
' Prompt user for destination file name.
DestFile = InputBox("Enter the destination filename" _
& Chr(10) & "(with complete path):", "Quote-Comma Exporter")
import numpy as np
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense, LSTM, Dropout, Conv2D, Reshape, TimeDistributed, Flatten, Conv1D,ConvLSTM2D, MaxPooling1D
from keras.layers.core import Dense, Activation, Dropout
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error
import tensorflow as tf
import matplotlib.pyplot as plt
@information-security
information-security / mac_vpn_route.txt
Created October 16, 2020 03:35
How to automatically add routes after VPN connections in MAC OSX
Create the file /etc/ppp/ip-up with following content:
#!/bin/sh
/sbin/route add <SUBNET> -interface $1
replacing <SUBNET> with subnet, you want to route through VPN (for ex. 192.168.0.0/16)
execute as root:
chmod 0755 /etc/ppp/ip-up
This file will be executed each time you connect to VPN.
@information-security
information-security / ssh_public_private_key.txt
Created October 30, 2020 02:59
How to enable Public/Private key ssh authentication
Just try these following commands
1) ssh-keygen
Press Enter key till you get the prompt
2) ssh-copy-id -i ~/.ssh/id_rsa.pub root@ip_address
(It will once ask for the password of the host system)
3) ssh root@ip_address
Now you should be able to login without any password
@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
@information-security
information-security / fake_webcam_stream.bat
Last active November 15, 2024 08:36
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 / 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 / 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 / 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