Skip to content

Instantly share code, notes, and snippets.

@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.
@Humoud
Humoud / syn-poc.rb
Last active August 13, 2016 09:39 — forked from KINGSABRI/syn-poc.rb
Build TCP/IP packet using packetfu lib, and send syn(or whatever you want) packet
#!/usr/bin/env ruby
# Full Contol on Ethnet, IP & TCP headers. Play with it ;)
# to test it: nc -lvp 4444
# as root: tcpdump -nvvvv 'tcp port 4444' -i wlan0 # change wlan0 to your interface
# or use packetfu to monitor as tcpdump
# on OSX exchange wlan0 to en0
## cap = PacketFu::Capture.new(:iface => 'wlan0' , :promisc=> true)
## cap.show_live(:filter => 'tcp and port 4444')
# libpcap should be installed
# gem install pcaprub packetfu
@Humoud
Humoud / db-connect-test.php
Last active March 7, 2016 11:42 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
###
# NOTE: This code won't work with PHP 7.
# MySQL is deprecated and will be removed in PHP 7 checkout MySQLi.
###
############## JUST FILL THESE VARIABLES ######
$dbname = 'name'; # Name of the Database in the MySQL Server
$dbuser = 'user'; # User name of the database in MySQL
$dbpass = 'pass'; # Password for the user of in database in MySQL
$dbhost = 'host'; # url/link to database