make code shorter by defining macos? linux?
This commit is contained in:
parent
aebaf45987
commit
bd79e2b270
21
Rakefile
21
Rakefile
@ -2,6 +2,14 @@ require 'rake'
|
|||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require File.join(File.dirname(__FILE__), 'bin', 'yadr', 'vundle')
|
require File.join(File.dirname(__FILE__), 'bin', 'yadr', 'vundle')
|
||||||
|
|
||||||
|
def macos?
|
||||||
|
RUBY_PLATFORM.downcase.include?("darwin")
|
||||||
|
end
|
||||||
|
|
||||||
|
def linux?
|
||||||
|
RUBY_PLATFORM.downcase.include?("linux")
|
||||||
|
end
|
||||||
|
|
||||||
# this has all the runcoms from this directory.
|
# this has all the runcoms from this directory.
|
||||||
task :link_files do
|
task :link_files do
|
||||||
install_files(Dir.glob('git/*')) if want_to_install?('git configs (color, aliases)')
|
install_files(Dir.glob('git/*')) if want_to_install?('git configs (color, aliases)')
|
||||||
@ -23,7 +31,7 @@ task :install => [:submodule_init, :submodules] do
|
|||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
puts
|
puts
|
||||||
|
|
||||||
install_homebrew if RUBY_PLATFORM.downcase.include?("darwin")
|
install_homebrew if macos?
|
||||||
install_rvm_binstubs
|
install_rvm_binstubs
|
||||||
|
|
||||||
Rake::Task["link_files"].execute
|
Rake::Task["link_files"].execute
|
||||||
@ -32,13 +40,13 @@ task :install => [:submodule_init, :submodules] do
|
|||||||
Rake::Task["install_vundle"].execute
|
Rake::Task["install_vundle"].execute
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Rake::Task["install_tools"].execute
|
||||||
Rake::Task["install_ycm"].execute
|
Rake::Task["install_ycm"].execute
|
||||||
|
|
||||||
Rake::Task["install_prezto"].execute
|
Rake::Task["install_prezto"].execute
|
||||||
|
|
||||||
install_fonts
|
install_fonts
|
||||||
|
|
||||||
install_term_theme if RUBY_PLATFORM.downcase.include?("darwin")
|
install_term_theme if macos?
|
||||||
|
|
||||||
run_bundle_config
|
run_bundle_config
|
||||||
|
|
||||||
@ -61,6 +69,7 @@ task :install_ycm do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc 'Install tools which are necessary for developers'
|
||||||
task :install_tools do
|
task :install_tools do
|
||||||
if macos?
|
if macos?
|
||||||
run %{
|
run %{
|
||||||
@ -165,7 +174,7 @@ def run(cmd)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def number_of_cores
|
def number_of_cores
|
||||||
if RUBY_PLATFORM.downcase.include?("darwin")
|
if macos?
|
||||||
cores = run %{ sysctl -n hw.ncpu }
|
cores = run %{ sysctl -n hw.ncpu }
|
||||||
else
|
else
|
||||||
cores = run %{ nproc }
|
cores = run %{ nproc }
|
||||||
@ -226,8 +235,8 @@ def install_fonts
|
|||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
puts "Installing patched fonts for Powerline/Lightline."
|
puts "Installing patched fonts for Powerline/Lightline."
|
||||||
puts "======================================================"
|
puts "======================================================"
|
||||||
run %{ cp -f $HOME/.yadr/fonts/* $HOME/Library/Fonts } if RUBY_PLATFORM.downcase.include?("darwin")
|
run %{ cp -f $HOME/.yadr/fonts/* $HOME/Library/Fonts } if macos?
|
||||||
run %{ mkdir -p ~/.fonts && cp ~/.yadr/fonts/* ~/.fonts && fc-cache -vf ~/.fonts } if RUBY_PLATFORM.downcase.include?("linux")
|
run %{ mkdir -p ~/.fonts && cp ~/.yadr/fonts/* ~/.fonts && fc-cache -vf ~/.fonts } if linux?
|
||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
96
etc/proxychains.conf
Normal file
96
etc/proxychains.conf
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
# proxychains.conf VER 4
|
||||||
|
#
|
||||||
|
# HTTP, SOCKS4, SOCKS5 tunneling proxifier with DNS.
|
||||||
|
#
|
||||||
|
|
||||||
|
# The option below identifies how the ProxyList is treated.
|
||||||
|
# only one option should be uncommented at time,
|
||||||
|
# otherwise the last appearing option will be accepted
|
||||||
|
#
|
||||||
|
#dynamic_chain
|
||||||
|
#
|
||||||
|
# Dynamic - Each connection will be done via chained proxies
|
||||||
|
# all proxies chained in the order as they appear in the list
|
||||||
|
# at least one proxy must be online to play in chain
|
||||||
|
# (dead proxies are skipped)
|
||||||
|
# otherwise EINTR is returned to the app
|
||||||
|
#
|
||||||
|
strict_chain
|
||||||
|
#
|
||||||
|
# Strict - Each connection will be done via chained proxies
|
||||||
|
# all proxies chained in the order as they appear in the list
|
||||||
|
# all proxies must be online to play in chain
|
||||||
|
# otherwise EINTR is returned to the app
|
||||||
|
#
|
||||||
|
#random_chain
|
||||||
|
#
|
||||||
|
# Random - Each connection will be done via random proxy
|
||||||
|
# (or proxy chain, see chain_len) from the list.
|
||||||
|
# this option is good to test your IDS :)
|
||||||
|
|
||||||
|
# Make sense only if random_chain
|
||||||
|
#chain_len = 2
|
||||||
|
|
||||||
|
# Quiet mode (no output from library)
|
||||||
|
quiet_mode
|
||||||
|
|
||||||
|
# Proxy DNS requests - no leak for DNS data
|
||||||
|
proxy_dns
|
||||||
|
|
||||||
|
# set the class A subnet number to usefor use of the internal remote DNS mapping
|
||||||
|
# we use the reserved 224.x.x.x range by default,
|
||||||
|
# if the proxified app does a DNS request, we will return an IP from that range.
|
||||||
|
# on further accesses to this ip we will send the saved DNS name to the proxy.
|
||||||
|
# in case some control-freak app checks the returned ip, and denies to
|
||||||
|
# connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x.
|
||||||
|
# of course you should make sure that the proxified app does not need
|
||||||
|
# *real* access to this subnet.
|
||||||
|
# i.e. dont use the same subnet then in the localnet section
|
||||||
|
#remote_dns_subnet 127
|
||||||
|
#remote_dns_subnet 10
|
||||||
|
remote_dns_subnet 224
|
||||||
|
|
||||||
|
# Some timeouts in milliseconds
|
||||||
|
tcp_read_time_out 15000
|
||||||
|
tcp_connect_time_out 8000
|
||||||
|
|
||||||
|
# By default enable localnet for loopback address ranges
|
||||||
|
# RFC5735 Loopback address range
|
||||||
|
localnet 127.0.0.0/255.0.0.0
|
||||||
|
# RFC1918 Private Address Ranges
|
||||||
|
localnet 10.0.0.0/255.0.0.0
|
||||||
|
localnet 172.16.0.0/255.240.0.0
|
||||||
|
localnet 192.168.0.0/255.255.0.0
|
||||||
|
|
||||||
|
|
||||||
|
# Example for localnet exclusion
|
||||||
|
## Exclude connections to 192.168.1.0/24 with port 80
|
||||||
|
# localnet 192.168.1.0:80/255.255.255.0
|
||||||
|
|
||||||
|
## Exclude connections to 192.168.100.0/24
|
||||||
|
# localnet 192.168.100.0/255.255.255.0
|
||||||
|
|
||||||
|
## Exclude connections to ANYwhere with port 80
|
||||||
|
# localnet 0.0.0.0:80/0.0.0.0
|
||||||
|
|
||||||
|
# ProxyList format
|
||||||
|
# type host port [user pass]
|
||||||
|
# (values separated by 'tab' or 'blank')
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
#
|
||||||
|
# socks5 192.168.67.78 1080 lamer secret
|
||||||
|
# http 192.168.89.3 8080 justu hidden
|
||||||
|
# socks4 192.168.1.49 1080
|
||||||
|
# http 192.168.39.93 8080
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# proxy types: http, socks4, socks5
|
||||||
|
# ( auth types supported: "basic"-http "user/pass"-socks )
|
||||||
|
#
|
||||||
|
[ProxyList]
|
||||||
|
# add proxy here ...
|
||||||
|
# meanwile
|
||||||
|
# defaults set to "tor"
|
||||||
|
socks5 127.0.0.1 1080
|
Loading…
Reference in New Issue
Block a user