Skip to content

Instantly share code, notes, and snippets.

@ehsanhoushmand
ehsanhoushmand / openconnect.sh
Created November 8, 2019 07:33
openconnect script
#!/bin/bash
username=""
password=""
url="nl.cisadd3.com:800"
pidfile="/tmp/openconnect-pid"
case "$1" in
start)
#bad certs
@ehsanhoushmand
ehsanhoushmand / install oracle client on linux.md
Last active June 15, 2019 12:45
install oracle client and sdk on linux

step 1: get oracle libs

Step 2: install pear and alien

  • sudo apt install alien php7.[php version]-dev php-pear

Step 3: install client

  • sudo alien -i oracle-instantclient*-basic-[oracle_version].rpm
  • sudo alien -i oracle-instantclient*-devel-[oracle_version].rpm [centos
@ehsanhoushmand
ehsanhoushmand / add ubuntu resolation.md
Last active May 26, 2019 06:50
ubuntu add resolation 1920x1080
xrandr
  • [monitor-name] connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 800x600 60.32 56.25
    848x480 60.00
    640x480 59.94
sudo cvt 1920 1080 60
  • 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --newmode **"1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync**
sudo xrandr --addmode [monitor-name] 1920x1080_60.00
@ehsanhoushmand
ehsanhoushmand / generate all combinations.php
Last active September 12, 2021 12:59
php algorithm to generate all combinations of a specific size from a single set
function sampling($chars, $size, $combinations = array()) {
# if it's the first iteration, the first set
# of combinations is the same as the set of characters
if (empty($combinations)) {
$combinations = $chars;
}
# we're done if we're at size 1
if ($size == 1) {
@ehsanhoushmand
ehsanhoushmand / extend vdi or vmdk hard disks on virtualbox
Created June 2, 2018 05:31
extend hard disk of virtual linux machine on virtualbox
#first convert vmdk to vdi format
vboxmanage clonehd disk.vmdk cloned.vdi --format vdi
#resize the vdi (in MB)
vboxmanage modifyhd cloned.vdi --resize 51200
# convert to vmdk format (optional)
vboxmanage clonehd cloned.vdi resized.vmdk --format vmdk
# download gparted live to extend the hard disk and the iso file from setting > storage > add optical drive and delete the old vmdk file and add new hard disk(resized.vmdk)
# then from setting > system > motherboared > change boot order from hard disk to optical .
# after that start the virtual machine and boot gparted.
# from gparted extend the old drive to new size and shutdown the machine.
@ehsanhoushmand
ehsanhoushmand / fanap_login.sh
Last active June 2, 2018 05:35
Fanap payment kerio login script
curl --request POST 'http://10.21.30.1:8002/index.php?zone=developmetzonecp&redirurl=http%3A%2F%2Flogin.etick.ir%3A8002%2F' --data "accept=Continue&auth_pass=ehsan&auth_user=ehsan&redirurl=http://10.21.30.1:8002/index.php?zone=developmetzonecp&zone=developmetzonecp" --verbose