Skip to content

Instantly share code, notes, and snippets.

View sharif0777's full-sized avatar

Md. Shariful Islam sharif0777

  • Infolytx Bangladesh Ltd.
  • 6th Floor, 339/B Shaheed Tajuddin Ahmed Ave, Dhaka 1208
View GitHub Profile
@sharif0777
sharif0777 / ssl-cert-info.sh
Created December 2, 2017 15:16
Shell script to check SSL certificate info like expiration date and subject. Taken from http://giantdorks.org/alain/shell-script-to-check-ssl-certificate-info-like-expiration-date-and-subject/
#!/bin/bash
usage()
{
cat <<EOF
Usage: $(basename $0) [options]
This shell script is a simple wrapper around the openssl binary. It uses
s_client to get certificate information from remote hosts, or x509 for local
certificate files. It can parse out some of the openssl output or just dump all
@sharif0777
sharif0777 / .htaccess
Created November 29, 2017 18:12 — forked from kirb/.htaccess
Self-hosted Cydia Repo Download Counter
RewriteEngine On
RewriteBase /
RewriteRule ^repo/downloads(\/?)$ /repo/counter.php?filename=Packages [L]
RewriteRule ^repo/Packages$ /repo/counter.php?filename=Packages [L]
RewriteRule ^repo/downloads/(.*)\.deb$ /repo/counter.php?filename=$1 [QSA]
@sharif0777
sharif0777 / Jenkinsfile
Created November 18, 2017 19:36 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
@sharif0777
sharif0777 / parse_yaml.sh
Created November 12, 2017 18:55 — forked from pkuczynski/parse_yaml.sh
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
$file = "C:\Path\To\Your\File.zip"
$destination = "C:\DestinationPath"
Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::ExtractToDirectory($file, $destination)
@sharif0777
sharif0777 / ZipFolder.ps1
Created May 30, 2017 06:39 — forked from stefanteixeira/ZipFolder.ps1
PowerShell script to compress a directory to a .zip file
$source = "C:\Path\To\Directory"
$destination = "C:\Path\To\Zip\file.zip"
If(Test-path $destination) {Remove-item $destination}
Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::CreateFromDirectory($Source, $destination)
@sharif0777
sharif0777 / ConfigWinFirewall.ps1
Created May 30, 2017 06:39 — forked from stefanteixeira/ConfigWinFirewall.ps1
PowerShell sample script to configure a Windows firewall rule
New-NetFirewallRule -DisplayName "MSSQL" -Direction Inbound -LocalPort 1433 -Protocol TCP -Action Allow