Skip to content

Instantly share code, notes, and snippets.

@Humoud
Humoud / .vimrc
Created August 26, 2022 12:29
basic vim rc file
set number
set visualbell
set ruler
colorscheme desert
@Humoud
Humoud / MongoDBHandler.py
Created June 25, 2022 08:43
think it works
import json
from bson import json_util
from bson.objectid import ObjectId
import pymongo
class MongoDBHandler():
"""
Binlex MongoDB Handler
"""
@Humoud
Humoud / install.sh
Last active October 22, 2022 11:56
Install Docker and Docker-Compose on Ubuntu 22.04
# Install docker
apt update &&\
apt -y install apt-transport-https ca-certificates curl software-properties-common &&\
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &&\
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable" &&\
apt-cache policy docker-ce &&\
apt -y install docker-ce
# Install docker compose
# check https://github.com/docker/compose/releases for version
hxxp[://]moonlabmediacompany[.]com/campaign1/SunLabsPlayer[.]exe
32-Bit Executable
MD5: afb06a90723fb2f5982ac2937f0d1086
SHA256: 7fc997a8885e7e75855f8865c02ef86b00b51cb8a726c1eb43b1e658c00d1d69
hxxp[://]moonlabmediacompany[.]com/data/data[.]7z
7zip Encrypted Archive, downloaded by SunLabsPlayer[.]exe
MD5: fc809f01a557d962b12c9da1f108b7fd
SHA256: 6a023a89c0d0b1e1e3cacdfd4237eefe5a8071dd0e30d92bb421f4e67b8dc585
@Humoud
Humoud / new_domains.sh
Created April 23, 2020 17:35
Tracking Newly Registered Domains
#!/bin/bash
# upgraded and modified from: https://isc.sans.edu/forums/diary/Tracking+Newly+Registered+Domains/23127/
TODAY=`date --date="-1 day" +"%Y-%m-%d"`
PARAM=`echo -n "$TODAY.zip" | base64`
DESTDIR="/opt/dns/domains"
URL="https://whoisds.com/whois-database/newly-registered-domains/$PARAM/nrd"
USERAGENT="DataBot/1.0"
TEMPFILE=`mktemp /tmp/wget_XXXXXX.zip`
@Humoud
Humoud / setup_offshore_env.sh
Created June 28, 2019 08:35
Automate CTF env setup
#!/bin/bash
####################
# colors
green=`tput setaf 2`
reset=`tput sgr0`
####################
echo "${green}Switching directory...${reset}"
cd /mnt/hgfs/share/offshore/
@Humoud
Humoud / upload-images-s3-sdk-ruby.rb
Created July 3, 2017 20:20 — forked from Bijendra/upload-images-s3-sdk-ruby
Upload images to AWS S3 in rails application using aws-sdk
#Using gem aws-sdk for a ror application for uploading images to s3
#Uploading images to a fixed bucket with different folders for each object or application.
#The s3 keeps a limitation on the number of buckets creattion whereas there is no
#limitation for content inside a bucket.
#This code will upload image for a user to s3 using aws-sdk gem. The bucket and the image uploaded are made public
#so that the images uploaded are directly accessible. The input it takes is the image complete path
#where it is present, folder in which it should be uploaded and user_id for whom it should
#be uploaded.
#### GraphQL Stuff ####
post '/graphql', to: 'graphql#query'
if Rails.env.development?
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
end
# Create user type
UserType = GraphQL::ObjectType.define do
name 'User'
description 'Our user model/type for GraphQL'
# specify what fields this type has
field :id, !types.ID
field :email, !types.String
field :username, !types.String
end
class GraphqlController < ApplicationController
skip_before_action :verify_authenticity_token
def query
result_hash = Schema.execute(params[:query], variables: params[:variables])
render json: result_hash
end
end