March 16, 2020

Tmux Sheet Cheat

# remap prefix from 'C-b' to 'C-a' unbind C-b set-option -g prefix C-a bind-key C-a send-prefix #setting the delay between prefix and command set -s escape-time 1 #Set the base index for windows to 1 instead of 0 set -g base-index 1 bind r source-file ~/.tmux.conf #Set the default terminal mode to 256color mode set -g default-terminal "screen-256color" #SET Color for the active window setw -g window-status-current-style fg=white,bold,bg=red #Status line righ side - 31-Oct 13:37 set -g status-right "#[fg=black]%d %b %R" #Update the status line every sixty seconds set -g status-interval 60 #set the color of the window list setw -g window-status-style fg=cyan,bg=black #enable vi keys. Read more

May 15, 2019

Nexpose

Nexpose components: Security Console - This is the component you’ll use to create sites, run scans, generate reports, and much more. The Security Console is accessed via a web-based user interface through any of our supported browsers. PostgreSQL database - The embedded PostgreSQL databases stores all the asset scan data and is used for generating reports. Local Scan Engine - Scan Engines are responsible for performing scan jobs on your assets. Read more

May 15, 2019

Macos Bash

export PS1="\[\033[0m\]\w\$ " export CLICOLOR=1 export LSCOLORS=ExFxBxDxCxegedabagacad alias ls='ls -GFh'

May 4, 2019

Nmap

Nmap is an open-source network scanner. It is used to discover hosts and services on a computer network by sending packets and analyzing the responses. Features Host discovery Identifying hosts on a network. For example, listing the hosts that respond to TCP and/or ICMP requests or have a particular port open. Port scanning Enumerating the open ports on target hosts. Version detection – Interrogating network services on remote devices to determine application name and version number OS detection – Determining the operating system and hardware characteristics of network devices. Read more

June 26, 2018

SNMP Configuration Juniper SRX

Allow SNMP service from Security Zone set security zones security-zone trust host-inbound-traffic system-services snmp Set snap community and Allowed clients set snmp community ZIodZHut3jTjHRiYBzpg authorization read-only set snmp community ZIodZHut3jTjHRiYBzpg clients 10.11.50.137/32

June 23, 2018

Timezone Convert Python

Install pytz module pip install pytz from datetime import datetime from pytz import timezone fmt = "%b %d %H:%M" # Current time in UTC utc_time = datetime.now(timezone('UTC')) # Convert to IST time zone ist_time = utc_time.astimezone(timezone('Asia/Kolkata')) ist_time = ist_time.strftime(fmt) print ist_time

June 23, 2018

Django Http Request Meta

A standard Python dictionary containing all available HTTP headers. Available headers depend on the client and server, but here are some examples: request.META.get('HTTP_USER_AGENT') CONTENT_LENGTH – The length of the request body (as a string). CONTENT_TYPE – The MIME type of the request body. HTTP_ACCEPT – Acceptable content types for the response. HTTP_ACCEPT_ENCODING – Acceptable encodings for the response. HTTP_ACCEPT_LANGUAGE – Acceptable languages for the response. HTTP_HOST – The HTTP Host header sent by the client. Read more

June 23, 2018

Git Commands

Major GIT commands: git config Sets configuration values for your user name, email, gpg key, preferred diff algorithm, file formats and more. Example: git config –global user.name “My Name” git config –global user.email “user@domain.com” cat ~/.gitconfig [user] name = My Name email = user@domain.com git init Initializes a git repository – creates the initial ‘.git’ directory in a new or in an existing project. Example: cd /home/user/my_new_git_folder/ git init Read more

June 23, 2018

NAT Configuration ASA

Static NAT object network host-10.29.29.33 host 10.29.29.33 nat (dmz,outside) static 103.252.X.X access-list outside-inside extended permit ip any object host-10.29.29.33 Source NAT object network net-10.29.0.0 nat (any,outside) dynamic interface object network host-10.29.20.62

June 23, 2018

NAT Configuration Netscreen

set interface "<INTERFACE_NAME>" mip <PUBLIC_IP> host <PRIVATE_IP> netmask 255.255.255.255 vr "trust-vr" set policy id 200 from "Untrust" to "Trust" "Any-IPv4" "MIP(<PUBLIC_IP>)" "ANY" permit log

June 23, 2018

Django and Mysql in Ubuntu

Install required packages sudo apt-get install python-pip python-dev python-virtualenv mysql-server libmysqlclient-dev Create project and virtualenv mkdir ipinfinity && cd ipinfinity virtualenv venv pip install "django<1.9" mysqlclient Create database in Mysql and change setting in django Change database setting to mysql DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'myproject', 'USER': 'myprojectuser', 'PASSWORD': 'password', 'HOST': 'localhost', 'PORT': '', } } Migrate to Mysql and create super user python manage. Read more

June 22, 2018

Juniper SRX Sessions

Display Sessions Summary show security flow session summary Display All Sessions show security flow session Terminate All Sessions clear security flow session all Display a Specific Source IP / Subnet Session show security flow session source-prefix 10.29.29.93 show security flow session source-prefix 10.29.28.0/24 Display a Specific Destination IP / Subnet / Port Session show security flow session destination-prefix 4.2.2.2 show security flow session destination-prefix 8.8.8.0/8 show security flow session destination-port 80 Terminate the session whose session ID you specify clear security flow session session-identifier 40000381

June 22, 2018

Pat Configuration Vyatta

PAT Configuration in Vyatta set nat source rule 10 outbound-interface eth0 set nat source rule 10 source address 10.29.29.0/24 set nat source rule 10 translation address masquerade

June 23, 2014

SSH Configuration ASA

Set hostname asa(config)# hostname asa1 Set domain name asa1(config)# domain-name blog.smsid.in Create RSA Key asa1(config)# crypto key generate rsa modulus 1024 Allow ssh from inside/ Outside asa1(config)# ssh 0.0.0.0 0.0.0.0 outside asa1(config)# ssh 0.0.0.0 0.0.0.0 inside Create Local user account asa1(config)# username admin password ******* privilege 15 Local user account database to SSH AAA group asa1(config)# aaa authentication ssh console LOCAL

June 22, 2014

Ubuntu Static IP Address

Static IP Configuration Debian & Ubuntu Edit :/etc/network/interfaces vi /etc/network/interfaces # The loopback interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 10.29.29.61 netmask 255.255.255.0 network 10.29.29.0 broadcast 10.29.29.255 gateway 10.29.29.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 10.29.29.10 # Configuration for eth0 aliases # This line ensures that the interface will be brought up during boot. Read more

March 22, 2014

Kvm and Openvswitch Ubuntu 14

Update packages apt-get update && apt-get upgrade Install Packages apt-get install openvswitch-switch qemu-kvm libvirt-bin Ubuntu Box has 2 NIC eth0 - only management traffic which is connected to Cisco 3560X port number g0/44 eth1 - Traffic for VM’s(all vlans) - connected to Cisco 3560X port number g0/46 Cisco Configuration interface GigabitEthernet0/44 description *** Connected Monitoring02 eth0 *** switchport access vlan 20 switchport mode access spanning-tree portfast interface GigabitEthernet0/46 description *** Connected Monitoring02 eth1 *** switchport trunk encapsulation dot1q switchport trunk allowed vlan 21-29 switchport mode trunk Update network configuration in ubuntu edit /etc/network/interfaces auto lo iface lo inet loopback # The primary network interface auto eth0 allow-hotplug eth0 iface eth0 inet static address 10. Read more

© Vijay Ronan 2020