Skip to content

Instantly share code, notes, and snippets.

View komljen's full-sized avatar

Alen Komljen komljen

View GitHub Profile
@komljen
komljen / get.js
Last active December 29, 2015 23:59
This script will load whole webpage and return processed html. Also it will skip Google Analytics (ga.js). Usage: phantomjs get.js http://www.example.com More info here: http://www.techbar.me/performance-testing-with-phantomjs/
var page = require('webpage').create(),
system = require('system'),
address;
address = system.args[1];
page.onResourceRequested = function (requestData, request) {
if ((/ga.js/gi).test(requestData['url'])) {
console.log('Skiping: ' + requestData['url']);
request.abort();
@komljen
komljen / search_domains.py
Created December 3, 2013 08:24
USAGE: python search_domains.py -r 500
#!/usr/bin/env python
__author__ = 'Alen Komljen'
import urllib.request, re, time, argparse, os, platform
from socket import timeout
parser = argparse.ArgumentParser()
parser.add_argument('-r', action='store', dest='results_number', required=True, type=int, \
help='number of google results to check')
@komljen
komljen / get_headers.py
Created December 3, 2013 08:28
The python 3 script which will go through list of domains and find interesting http response headers for each domain. This script will go through list of domains defined here:”D:\Data\sites_ba_domain.txt” and as a result you will get .csv file “D:\server_info.txt” which can be easily transformed into excel spreadsheet.
#!/usr/bin/env python
__author__ = 'Alen Komljen'
import urllib.request, re, os.path, os
from socket import timeout
server_info = open("D:\server_info.txt", "w")
server_info.write("url, server_name, server_version, server_os \
, server_misc, poweredby_engine, poweredby_version \
@komljen
komljen / Vagrantfile
Last active August 29, 2015 14:11
Vagrantfile for Ubuntu Snappy with Docker
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "Snappy.box"
config.vm.box_url = "https://dl.dropboxusercontent.com/s/cd9cfhrmraif1op/Snappy.box"
config.vm.synced_folder '.', '/vagrant', disabled: true
config.ssh.username = "ubuntu"
config.ssh.password = "ubuntu"
config.vm.provider "virtualbox" do |v|
@komljen
komljen / shell_tips.sh
Last active September 13, 2024 08:16
Linux shell tips and tricks
# Suspend process:
Ctrl + z
# Move process to foreground:
fg
# Generate random hex number where n is number of characters:
openssl rand -hex n
# Execute commands from a file in the current shell:
@komljen
komljen / kube-flannel.yml
Last active March 20, 2023 11:24
Kubernetes flannel
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: flannel
namespace: kube-system
---
kind: ConfigMap
apiVersion: v1
metadata: