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 / 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 / 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 / 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.
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 / 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")
@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