This file contains 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
# from http://www.debuntu.org/how-to-redirecting-network-traffic-a-new-ip-using-iptables | |
# enable ip forwarding until reboot | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
# enable ip forwarding after reboot | |
# edit /etc/sysctl.conf | |
# uncomment line: #net.ipv4.ip_forward=1 | |
This file contains 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
from: http://www.meandmark.com/keycodes.html | |
with some additions from people in the comments, thanks :) | |
Virtual Keycodes for the Mac QWERTY Layout | |
Keycodes are in hexadecimal. A blank entry means either there is no key assigned to that keycode or I was unable to find the assigned key. | |
Keycode Key | |
0x00 A | |
0x01 S | |
0x02 D |
This file contains 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
make sure the following lines are set in /etc/sshd_config (or /etc/ssh/sshd_config on ubuntu) | |
(they all exist already, but are commented, some may have a value of yes) | |
PasswordAuthentication no | |
ChallengeResponseAuthentication no | |
UsePAM no | |
then restart the ssh server (uncheck / recheck 'Remote Login' in the 'System Preferences' -> 'Sharing' panel) |
This file contains 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
#execute the following from the command prompt | |
mstsc /v:<ip-address> /admin | |
you can kick other people off by running (on the remote box) | |
query session | |
then | |
logoff <sessionid> /server /v |
This file contains 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
// | |
// ContentView.swift | |
// TestTabs | |
// | |
// Created by Kem Mason on 24/02/23. | |
// | |
import SwiftUI | |
enum TopNavTag: Hashable { |
This file contains 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
# so recently I had an issue where I wanted to send email sent to a local user root (from logwatch, e.g.) to a different email address | |
# simple enough -- just add a ~root/.forward file, with the contents root-handler-testing@gmail.com | |
# all the email gets sent there... | |
# but the email shows up with a to: header of root@my-example-machine.com | |
# what I really want is the to: header to be root-handler-testing@gmail.com | |
# so I can filter emails, etc... below is how to do that. | |
#uncomment the following line in /etc/postfix/main.cf | |
#header_checks = regexp:/etc/postfix/header_checks |
This file contains 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
#partially from: | |
#http://openvpn.net/index.php/open-source/documentation/miscellaneous/78-static-key-mini-howto.html | |
# in this I refer to the server and the client -- really the only difference here is that the 'server' | |
# needs to have a publicly accessible IP, and be configured to allow UDP port 1194 to connect inbound | |
iptables -A INPUT -s <put-client-public-ip-address-here> -p udp -m udp --dport 1194 -j ACCEPT | |
# other than that, they can communicate both ways, assuming the client firewall is configured to allow it | |
# (to firewall the client to prevent all server connections, see below) | |
# don't forget to save your iptables configurations after making them -- https://gist.github.com/958060 | |
#on server, make sure openvpn is installed (on ubuntu it's simply: aptitude install openvpn) | |
# to install on rhel5, follow this: https://gist.github.com/957868 |
This file contains 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
# client | |
ip_addr = 'server_addr'; require 'socket'; loop { begin; sock = TCPSocket.new(ip_addr, 2000); while (str = sock.readline) do puts str; end; rescue EOFError; sleep 1; next; rescue Errno::ECONNREFUSED; puts "FAIL"; end; sleep 1; } | |
# server | |
require 'socket'; server = TCPServer.new 2000; loop { Thread.start(server.accept) do |client| client.puts "Hello !"; client.puts "Time is #{Time.now}"; client.close; puts "Handled request at #{Time.now}"; end; } |
This file contains 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
source 'http://rubygems.org' | |
gem 'rack' | |
gem 'sinatra' | |
gem 'dm-core' | |
gem 'haml' | |
gem 'dm-postgres-adapter' | |
gem 'dm-migrations' | |
gem 'pg' |
This file contains 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
#this will save off a single commits patch, so you can apply it | |
# if you leave off from --stdout to the right, it'll create a patchfile in the current directory with a name | |
# that includes the comment from the commit | |
git format-patch -1 095e61f --stdout > /tmp/patchname.patch | |
# this will check the patch to see if any conflicts will arise when applying it | |
git apply --check /tmp/patchname.patch | |
# this will apply the patch | |
git apply /tmp/patchname.patch |
NewerOlder