lord_iu

tmp

Nov 19th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.48 KB | None | 0 0
  1. lord@lord-arch-pi:~$ cat start-after.sh
  2. #!/bin/sh
  3. gpio reset
  4.  
  5. gpio mode 0 down
  6. gpio mode 1 down
  7. gpio mode 2 out
  8. gpio mode 3 out
  9. gpio mode 4 down
  10. gpio mode 6 down
  11. gpio mode 7 down
  12. gpio mode 10 down
  13. gpio mode 11 down
  14. gpio mode 12 down
  15. gpio mode 13 down
  16. gpio mode 14 down
  17. gpio mode 15 down
  18. gpio mode 16 down
  19. gpio mode 17 down
  20. gpio mode 18 down
  21. gpio mode 19 down
  22. gpio mode 20 down
  23.  
  24. ifconfig eth0 inet 192.168.1.1/24
  25. sleep 10
  26. netctl start wlan0-nsti_hotel_8
  27.  
  28. iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
  29. iptables -t nat -A POSTROUTING -o wlan0 -s 192.168.1.0/24 -d 192.168.13.1 -j SNAT --to 192.168.13.141
  30.  
  31. echo 1 > /proc/sys/net/ipv4/ip_forward
  32.  
  33. gpio write 3 1
  34. sleep 0.25
  35. gpio write 3 0
  36. sleep 0.25
  37. gpio write 3 1
  38. sleep 0.25
  39. gpio write 3 0
  40. sleep 0.25
  41. gpio write 3 1
  42. sleep 0.25
  43. gpio write 3 0
  44. lord@lord-arch-pi:~$ cat /etc/squid/squid.conf
  45. #
  46. # Recommended minimum configuration:
  47. #
  48.  
  49. # Example rule allowing access from your local networks.
  50. # Adapt to list your (internal) IP networks from where browsing
  51. # should be allowed
  52. acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
  53. acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
  54. acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
  55. acl localnet src fc00::/7       # RFC 4193 local private network range
  56. acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
  57.  
  58. acl SSL_ports port 443
  59. acl Safe_ports port 80          # http
  60. acl Safe_ports port 21          # ftp
  61. acl Safe_ports port 443         # https
  62. acl Safe_ports port 70          # gopher
  63. acl Safe_ports port 210         # wais
  64. acl Safe_ports port 1025-65535  # unregistered ports
  65. acl Safe_ports port 280         # http-mgmt
  66. acl Safe_ports port 488         # gss-http
  67. acl Safe_ports port 591         # filemaker
  68. acl Safe_ports port 777         # multiling http
  69. acl CONNECT method CONNECT
  70.  
  71. #
  72. # Recommended minimum Access Permission configuration:
  73. #
  74. # Deny requests to certain unsafe ports
  75. http_access deny !Safe_ports
  76.  
  77. # Deny CONNECT to other than secure SSL ports
  78. http_access deny CONNECT !SSL_ports
  79.  
  80. # Only allow cachemgr access from localhost
  81. http_access allow localhost manager
  82. http_access deny manager
  83.  
  84. # We strongly recommend the following be uncommented to protect innocent
  85. # web applications running on the proxy server who think the only
  86. # one who can access services on "localhost" is a local user
  87. #http_access deny to_localhost
  88.  
  89. #
  90. # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
  91. #
  92.  
  93. # Example rule allowing access from your local networks.
  94. # Adapt localnet in the ACL section to list your (internal) IP networks
  95. # from where browsing should be allowed
  96. http_access allow localnet
  97. http_access allow localhost
  98.  
  99. # And finally deny all other access to this proxy
  100. http_access deny all
  101.  
  102. # Squid normally listens to port 3128
  103. http_port 3128
  104.  
  105. # Uncomment and adjust the following to add a disk cache directory.
  106. #cache_dir ufs /var/cache/squid 256 16 256
  107.  
  108. # Leave coredumps in the first cache dir
  109. coredump_dir /var/cache/squid
  110.  
  111. #
  112. # Add any of your own refresh_pattern entries above these.
  113. #
  114. refresh_pattern ^ftp:           1440    20%     10080
  115. refresh_pattern ^gopher:        1440    0%      1440
  116. refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
  117. refresh_pattern .               0       20%     4320
  118.  
  119.  
  120.  
  121. ##custom
  122.  
  123. http_port 3128 transparent
  124. cache_peer 192.168.13.1 parent 3128 3130 default
  125. never_direct allow all
Advertisement
Add Comment
Please, Sign In to add comment