Skip to content

Instantly share code, notes, and snippets.

View ivikramsahu's full-sized avatar

Vikram Sahu ꩜ ivikramsahu

  • netcorecloud.com
  • india ❤
  • 16:45 (UTC +05:30)
  • X @ivikramsahu
View GitHub Profile
@ivikramsahu
ivikramsahu / openSpecPostmanChallenge.yaml
Created December 22, 2021 18:21
Updated yaml file for Scenario testing [Day 27] : 30 days of Challenge
openapi: 3.0.0
info:
title: The Good Bank APIs
version: 1.0.0
servers:
- url: http://security.postman-breakable.com
tags:
- name: Health
- name: Bank User
description: This folder contains APIs to manage users of The Good Bank.
@ivikramsahu
ivikramsahu / domain-from-subdomain.php
Last active March 8, 2021 07:12
Extracting main domain from url having subdomain (works with <any number of subdomain>.maindomain.<com|org|co>.<in|uk|ng|dl>)
<?php
echo "Running Domain extraction script at ".date('Y-m-d H:i:s')."\n\n";
if(empty($argv[1])){
echo "please enter in below format \n php domain-from-subdomain.php http://<subdomain/domain name>/xyz/mypath/to/some/image/folder\n";
exit;
}else{
if(explode(":",$argv[1])[0] == "http" || explode(":",$argv[1])[0] == "https"){
print get_domain($argv[1]);
@ivikramsahu
ivikramsahu / countries_codes_and_coordinates.csv
Created February 25, 2021 07:44 — forked from tadast/countries_codes_and_coordinates.csv
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
Antigua and Barbuda AG ATG 28 17.05 -61.8
@ivikramsahu
ivikramsahu / ssl-check.py
Created January 27, 2021 08:52 — forked from gdamjan/ssl-check.py
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket
@ivikramsahu
ivikramsahu / intro.md
Created September 29, 2020 10:11 — forked from derhuerst/intro.md
Installing Git on Linux, Mac OS X and Windows
@ivikramsahu
ivikramsahu / read-file.php
Created September 10, 2020 16:45
A php script for reading file 📂
<?php
$fh = fopen('domain-push-to-ehr.csv','r');
while($line = fgets($fh)){
$string = trim(preg_replace('/\s\s+/', '', $line));
$file = $string."_data.txt";
if (filter_var("$string", FILTER_VALIDATE_IP)) {
echo("$string is valid IP")
continue;
} else {
echo("$string is not a valid IP address");
@ivikramsahu
ivikramsahu / codeiginter-server-config.md
Created May 29, 2020 06:28 — forked from yidas/codeiginter-server-config.md
Codeigniter 3 server configuration for Nginx & Apache

Codeigniter 3 server configuration for Nginx & Apache

Web Server Site Configuration

Recommended Apache Configuration

Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot and ServerName fit to your environment:

@ivikramsahu
ivikramsahu / installcomposer.sh
Last active November 12, 2019 14:49
this gist as step for install composer on centos 8 or RHEL 8
sudo dnf install php* && \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
composer --version
@ivikramsahu
ivikramsahu / nginx.conf
Created September 20, 2019 10:14 — forked from jrom/nginx.conf
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@ivikramsahu
ivikramsahu / ansible-summary.md
Created August 10, 2019 14:37 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of