Skip to content

Instantly share code, notes, and snippets.

0xDEADBEEF JamesTheHacker

Block or report user

Report or block JamesTheHacker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@xameeramir
xameeramir / default nginx configuration file
Last active Apr 4, 2020
The default nginx configuration file inside /etc/nginx/sites-available/default
View default nginx configuration file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@gaearon
gaearon / connect.js
Last active Apr 1, 2020
connect.js explained
View connect.js
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@gaearon
gaearon / slim-redux.js
Last active Apr 5, 2020
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
View slim-redux.js
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@LouWii
LouWii / iptables-config-script
Last active Mar 16, 2020
Bash script to configure iptables for a web server. Some rules can be removed depending on used services.
View iptables-config-script
#!/bin/sh
# Empty all rules
sudo iptables -t filter -F
sudo iptables -t filter -X
# Bloc everything by default
sudo iptables -t filter -P INPUT DROP
sudo iptables -t filter -P FORWARD DROP
sudo iptables -t filter -P OUTPUT DROP
@sachin-handiekar
sachin-handiekar / gist:3317727
Created Aug 10, 2012
UK Access Point Name (APN) Settings for Mobile Broadband - UK
View gist:3317727
Note : Dial - *99#
Vodafone
Vodafone has several possible options for Pay As You Go SIM cards. Try each one in turn until the connection works. All use the same username and password.
APN (contract): internet
APN (PAYG): pp.internet
APN (PAYG): ppbundle.internet
APN (PAYG): smart
APN (PAYG): pp.vodafone.co.uk
You can’t perform that action at this time.