Skip to content

Instantly share code, notes, and snippets.

View mahradbt's full-sized avatar

Mahrad Ghazipour mahradbt

View GitHub Profile
@mahradbt
mahradbt / kerio-vpnClinet-linux-amd64.md
Last active November 20, 2023 11:59
install kerio-connect-vpn-client-amd64 on Centos 7

Install kerio vpn client on centos 7 amd 64

this tutorial show you how to install kerio vpnClient on centos7 64bit. kerio vpnClient does not have any .rpm official version! I tried install it during one week.

  1. first of all download kerio-control-vpnclient-###-linux-amd64.deb from http://www.ryadel.com/en/kerio-control-vpn-client-all-versions-direct-download-links/ which contain many version of kerio-control-vpn-client or everywhere else.

  2. after download kerio-control-vpnclient-###-linux-amd64.deb we must convert it to .rpm package, to convert .deb to .rpm use alien which convert packages ( https://packages.debian.org/unstable/source/alien )

@mahradbt
mahradbt / simple-java-helloworld-linux-script
Created September 17, 2017 10:57
script for simple java app jar file on linux
#!/bin/bash
touch hello.java
echo 'class Hello{public static void main(String[] args){System.out.println("Hello World");}}' > hello.java
javac hello.java
touch MANIFEST.MF
echo "Main-Class: Hello" > MANIFEST.MF
jar cmfv MANIFEST.MF Hello.jar *.class
java -jar Hello.jar
@mahradbt
mahradbt / simple-java-helloworld-linux-script
Created September 17, 2017 10:57
script for simple java app create jar file on linux
#!/bin/bash
touch hello.java
echo 'class Hello{public static void main(String[] args){System.out.println("Hello World");}}' > hello.java
javac hello.java
touch MANIFEST.MF
echo "Main-Class: Hello" > MANIFEST.MF
jar cmfv MANIFEST.MF Hello.jar *.class
java -jar Hello.jar
@mahradbt
mahradbt / vnc_kali.md
Last active March 30, 2023 15:44
vnc server kali

install: apt install tightvncserver xtightvncviewer

edit xstartup file located on $HOME/.vnc/xstartup

#!/bin/sh
def
export XKLXMODMAPDISABLE=1
unset SESSIONMANAGER
unset DBUSSESSIONBUSADDRESS
@mahradbt
mahradbt / nginx config
Created June 3, 2018 17:16
nginx config serve php and download pdf
server {
listen <port> ssl;
server_name <domain>;
ssl_certificate /etc/ssl/certs/cert.crt;
ssl_certificate_key /etc/ssl/private/cert.key;
access_log /home/<domain>/logs/<domain>.access.log main;
error_log /home/<domain>/logs/<domain>.error.log warn;
root /home/<domain>/public_html;
@mahradbt
mahradbt / pfx
Last active June 3, 2018 17:19
use pfx for nginx
openssl pkcs12 -in standard_certificate.pfx -nocerts -out key-encrypted.key
openssl pkcs12 -in standard_certificate.pfx -clcerts -nokeys -out certificate.crt
openssl rsa -in key-encrypted.key -out key-decrypted.key
openssl pkcs12 -in standard_certificate.pfx -out domain-ca.crt -nodes -nokeys -cacerts
cat certificate.crt domain-ca.crt > full_certificate.crt // for nginx cert

auto reindent and reformate tabs: gg=G

fix tabs:

filetype plugin indent on                                                               │
" show existing tab with 4 spaces width                                                 │
set tabstop=4                                                                           │
" when indenting with '>', use 4 spaces width                                           │
set shiftwidth=4                                                                        │
" On pressing tab, insert 4 spaces │