Skip to content

Instantly share code, notes, and snippets.

View soreana's full-sized avatar
🌷
:-)

Sina Kashipazha soreana

🌷
:-)
View GitHub Profile
#!/bin/bash
templatefilters=("all" "featured" "self" "selfexecutable" "sharedexecutable" "executable" "community")
accounts=("admin" "test" "test2")
if [[ '-h' == $1 ]]; then
echo -e "Usage explained:"
echo -e "\t-h shows this help"
echo -e "\t'./listTemplates.sh' list all filter"
@soreana
soreana / PDF_Reader.java
Last active September 28, 2020 19:41
Java PDF Reader
/**
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.19</version>
</dependency>
*/
import java.io.File;
import java.io.IOException;
@soreana
soreana / run_docker_with_bash.py
Created March 29, 2019 21:49
run docker containers with bash
import docker
import dockerpty
client = docker.APIClient(base_url='unix://var/run/docker.sock')
container = client.create_container(
image='mininet',
stdin_open=True,
tty=True
# command='/bin/sh',
)
@soreana
soreana / autologin.sh
Created March 24, 2019 10:16
automate ssh login using RSA
# Put your id_rsa.pub and autologin file at the same folder. Run `chmode +x autologin.sh` then `./autologin` to automate
# your login.
#!/bin/bash
mkdir -p ~/.ssh && \
chmod 700 ~/.ssh && \
touch ~/.ssh/authorized_keys2 && \
chmod 600 ~/.ssh/authorized_keys2 && \
cat ./id_rsa.pub >> ~/.ssh/authorized_keys2
### Slim version
FROM python:2.7-slim
MAINTAINER Nick Janetakis <nick.janetakis@gmail.com>
RUN apt-get update && apt-get install -qq -y \
build-essential libpq-dev libffi-dev --no-install-recommends
ENV INSTALL_PATH /bsawf
RUN mkdir -p $INSTALL_PATH
@soreana
soreana / nginx.conf
Last active May 13, 2021 23:35
Handy nginx docker server
# Run below command to start new nginx docker container which hosted files in /home/asa/downloads/ directory on http://<Host IP>:8090
# Keep in mind that this file (nginx.conf) should be in `/home/asa/desktop/nginx/` directory.
# `docker run --name nginx -p 8080:80 -v $HOME/downloads/:/usr/share/nginx/html/:ro -v $HOME/desktop/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -d --rm nginx`
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
#!/bin/bash
# Copyright 2018 Sina Kashipazha (sina_kashipazha@ut.ac.ir)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@soreana
soreana / bash_profile
Created April 27, 2018 20:38
my bash profile
alias cisco='sudo cp /opt/cisco/anyconnect/profile/profile.xml.backup /opt/cisco/anyconnect/profile/profile.xml'
alias rand='java -jar ~/.my_programs/rand-command.jar'
alias shamir='java -jar ~/.my_programs/secretshare.jar'
alias dec_m='sh ~/.my_programs/minecraft/dec_m.sh'
alias enc_m='sh ~/.my_programs/minecraft/enc_m.sh'
alias pg_start="launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist"
alias pg_stop="launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist"
alias add_ut_net="sudo route -n add -net 172.18.0.0/16 $(netstat -nr | grep default | awk '{print $2}')"
alias del_ut_net="sudo route -n delete -net 172.18.0.0/16 $(netstat -nr | grep default | awk '{print $2}')"
alias hpc="ssh pipe -t 'ssh hpc'"
@soreana
soreana / login.sh
Last active December 28, 2018 16:07
Scripts to login in University of Tehran Hotspot network.
38,0-1 84%
#!/bin/bash
# Copyright 2018 Sina Kashipazha (sina_kashipazha@ut.ac.ir)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@soreana
soreana / README.md
Created March 19, 2016 00:24 — forked from denji/README.md
Remove WebStorm; PhpStorm; PyCharm; RubyMine; AppCode; CLion, IntelliJ; 0xDBE10 settings and cli-links from Mac OSX

Quick uninstall JetBrains settings:

curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s