Skip to content

Instantly share code, notes, and snippets.

View shakibamoshiri's full-sized avatar

Shakiba Moshiri shakibamoshiri

View GitHub Profile
@stagas
stagas / how-to-run-apache-and-node.js-together-the-right-way.markdown
Created December 24, 2010 14:45
How to run Apache and Node.js together (the right way)

Step 1

Get a VPS that offers 2 or more IP addresses.

Step 2

From the WHM cPanel, find the menu item Service Configuration, select Apache Configuration and then click on Reserved IPs Editor.

Step 3

@pdkl95
pdkl95 / rubygems-completion.bash
Created December 15, 2011 07:48
bash tab completion for gem
#!/bin/bash
# -*- mode: bash -*-
#
# ---------------------------
# --= bash completion for the =--
# --= rubygems "gem" program =--
# ---------------------------
#
# Copyright C 2011 Brent Sanders <git@thoughtnoise.net>
# -> Derived losely from "git-completion.sh" in the git-sh
@ashrithr
ashrithr / ssh_tunneling.md
Last active July 22, 2022 21:25
ssh tunneling and port forwarding

###Single hop tunelling:

ssh -f -N -L 9906:127.0.0.1:3306 user@dev.example.com

where,

  • -f puts ssh in background
  • -N makes it not execute a remote command
@tuxfight3r
tuxfight3r / tcp_flags.txt
Last active May 22, 2024 02:24
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@EnigmaCurry
EnigmaCurry / vpn_namespace.md
Created April 7, 2016 02:28
OpenVPN and browser specific network routing with ip netns

OpenVPN and browser specific network routing with ip netns

Create network bridge

A network bridge allows us to have a virtual router that we can plug multiple network interfaces into. The IP address is assigned to the bridge rather than the individual network interface.

Create the bridge device, br0 :

@htp
htp / curl-websocket.sh
Last active May 14, 2024 21:24
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@noelboss
noelboss / git-deployment.md
Last active May 16, 2024 20:41
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@bom-d-van
bom-d-van / mysql-tcpdump.sh
Last active May 6, 2024 12:43
tcpdump advanced filters
# https://www.percona.com/blog/2008/11/07/poor-mans-query-logging/
tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e '
while(<>) { chomp; next if /^[^ ]+[ ]*$/;
if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)/i) {
if (defined $q) { print "$q\n"; }
$q=$_;
} else {
$_ =~ s/^[ \t]+//; $q.=" $_";
}
@akpoff
akpoff / curl_imap_query_commands.md
Created January 2, 2018 17:29
curl commands to query imap servers

curl commands to query imap servers

Based on https://busylog.net/telnet-imap-commands-note/

curl options

  • -k -- don't verify certificate (optional)
  • -n -- use .netrc for username and password (optional)
  • -X -- request to send to server
@lokimeyburg
lokimeyburg / pm-interview-questions.md
Last active May 1, 2024 06:07
Product Manager Interview Questions

Product Manager Interview Questions

General Questions:

  • Tell me about yourself.
  • Tell me about the most boring job you have ever had.
  • What changes would you make if you came on board?
  • What would you say to your boss if he is crazy about an idea, but you think it stinks?
  • Assuming that you are selected, what will be your strategy for next 60 days?
  • why are not you earning more money at this stage of your career?