Skip to content

Instantly share code, notes, and snippets.

@1v
1v / gist:ff5c3cd78b74e3248c1a
Last active August 29, 2015 14:01
How to pull request in MediaWIki
@1v
1v / gist:a38f247c41ca60f6e48a
Last active August 29, 2015 14:03 — forked from ancap/gist:7616833
Ruby on Rails "Hellow World" app

Ruby on Rails "Hellow World" app

Run:

rails g controller StaticPages index

In config/routes.rb add:

root "static_pages#index"

###Show variable contents from controller in view###

@1v
1v / gist:77595e676132a660843c
Last active July 14, 2016 18:49
Making production on port 80 and development on any other

Making production on port 80 and development on any other

Go to /etc/nginx/conf.d delete all files in it and create two files MyAppDevelopment.conf and MyAppProduction.conf (change MyApp to your app name).

Add to MyAppDevelopment.conf:

upstream MyAppDevelopment {
  server              unix:///tmp/MyAppDevelopment.sock;
}
@1v
1v / gist:702381c4440cdb8af85a
Created July 9, 2014 16:07
Ruby: Iterate thru all headers
self.request.headers.each do |header|
next if !header[1].is_a?(String)
@@debug["#{header[0]}"] = header[1]
end
@1v
1v / gist:7473b4acbaac0d79877d
Last active May 31, 2018 16:45
Nginx behind Apache

Nginx behind Apache

Install mod_proxy_http:

a2enmod proxy_http

Add to /etc/apache2/apache2.conf (change ip):

<VirtualHost 11.1.11.111:80 >
	ServerName site.com
@1v
1v / gist:04901ed17202cddfe42d
Last active November 12, 2020 20:49
God and Puma configuration

God and Puma configuration

Add to Gemfile:

gem 'puma'
gem 'god'

Run in app folder:

bundle install
@1v
1v / gist:1633180ce64af07e23d0
Last active August 29, 2015 14:04 — forked from anonymous/gist:107dc04a9d9199db1117
How to turn off ads in µTorrent

Options>preferences>Advanced...

Turn all these settings to false:

left_rail_offer
gui.show_plus_upsell
sponsored_torrent_offer_enabled
bt.enable_pulse
gui.show_notorrents_node
offers.content_offer_autoexec
@1v
1v / gist:e7099bc9321cac0d9aeb
Last active November 9, 2015 23:21
How to use bash "screen"

How to use bash "screen"

Install:

apt-get install screen

Open first screen:

screen

Detach screen:

@1v
1v / gist:a2a324e4205ead51ae93
Created October 12, 2014 01:27
s3cmd download is slow

Here’s a tip to fix it: the s3cmd upload/download speed can be tuned by modifying send_chunk/recv_chunk variables in the s3cfg configuration file (the default is 4096 – 4KB). source

wget http://nmap.org/dist/nmap-6.40.tar.bz2
tar -jxvf nmap-6.40.tar.bz2
cd nmap-6.40
./configure
make "LUA_LIBS=../liblua/liblua.a -ldl -lm"
sudo checkinstall
sudo dpkg -i nmap_6.40-1_amd64.deb

ubuntuforums.org