Skip to content

Instantly share code, notes, and snippets.

Jordano Moscoso Xosmond

Block or report user

Report or block Xosmond

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Xosmond
Xosmond / remote_sudo.rb
Created Dec 8, 2017 — forked from ainoya/remote_sudo.rb
Execute remote sudo command with net-ssh
View remote_sudo.rb
#!/usr/bin/env ruby
require 'net/ssh'
require 'highline/import'
def get_password
ask( "Enter Password: " ) {|q| q.echo = '*'}
end
def remote_sudo host, ssh_user, command, opts={}
View download_zip.rb
def download_zip(image_list)
unless image_list.blank?
file_name = 'pictures.zip'
stringio = Zip::ZipOutputStream::write_buffer do |z|
z.put_next_entry("empty_folder/") ## Create a folder
image_list.each do |img|
title = img.title
title += '.jpg' unless title.end_with?('.jpg')
@Xosmond
Xosmond / install.sh
Created Aug 31, 2017 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
View install.sh
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@Xosmond
Xosmond / rspec_rails_cheetsheet.rb
Created Jul 20, 2017 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
View rspec_rails_cheetsheet.rb
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@Xosmond
Xosmond / Vultr-add-dockercompose
Last active Mar 31, 2017 — forked from dmp1ce/vultr-ubuntu-15.04-configure
Configure Ubuntu 15.04 for docker-compose and decompose on Vultr.com
View Vultr-add-dockercompose
#!/bin/bash
# To run from shell:
# bash <(curl -sSL https://gist.githubusercontent.com/dmp1ce/84c31085745101f8c241/raw)
do_config() {
# Make sure to run as root
user="$(id -un 2>/dev/null || true)"
if [ "$user" != 'root' ]; then
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
View SHODAN Filters
» city
» country
nginx city:"San Diego" country:US
» geo
Devices within a 50km radius of San Diego (32.8,-117): geo:32.8,-117,50
» hostname
"Server: gws" hostname:google
» net
net:216.219.0.0/16
» os
@Xosmond
Xosmond / workaround.md
Created Jul 2, 2016 — forked from kgrz/workaround.md
Possible workaround for installing nokogiri 1.6.8 on OSX with brewed libxml2 2.9.4
View workaround.md

Problem:

The following commands fail on OSX:

gem install nokogiri
gem install nokogiri -- --use-system-libraries
gem install nokogiri -- --use-system-libraries --with-xslt-dir=/usr/local/opt/libxslt --with-xml2-dir=/usr/local/opt/libxml2

Version:

@Xosmond
Xosmond / gist:0656fa5f378c007c3e0e1ce48fffb008
Created Jun 10, 2016 — forked from joho/gist:3735740
PostgreSQL 9.2 upgrade steps
View gist:0656fa5f378c007c3e0e1ce48fffb008
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
You can’t perform that action at this time.