Skip to content

Instantly share code, notes, and snippets.

View user454322's full-sized avatar
💭
I may be slow to respond.

Javier user454322

💭
I may be slow to respond.
View GitHub Profile
@user454322
user454322 / leonet.sh
Created September 4, 2012 15:05
Script to automatically authenticate with leo-net.jp
#!/bin/sh
sleep 7
/usr/bin/wget --http-user="5550156" --http-passwd="5555258" --proxy-user="5550156" --proxy-password="555258" --output-document=/dev/null --append-output=/var/log/leonet http://google.com
exit 0
#This script is located at /usr/local/bin/leonet
#
@user454322
user454322 / git-info.sh
Last active April 28, 2016 05:54 — forked from shrwnsan/.profile
git similar to svn info.From stechico
#!/usr/bin/env bash
# author: Duane Johnson
# email: duane.johnson@gmail.com
# date: 2008 Jun 12
# license: MIT
#
# Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496
pushd . >/dev/null
mvn clean javadoc:jar source:jar deploy
bin/catalina.sh jpda start
@user454322
user454322 / .inputrc
Last active February 8, 2016 01:26
.inputrc
set completion-ignore-case on
set editing-mode vi
set keymap vi
Clock options
Custom format
%b %d日 (%a) %H:%M:%S
#!/bin/bash
# Prints information about the Java threads that consumes most of the CPU
# Derived from the information given in the blog entry at
#
# http://nurkiewicz.blogspot.be/2012/08/which-java-thread-consumes-my-cpu.html
#
# Changelog:
#
# - Removed the `top', `perl', and `grep' dependencies.
@user454322
user454322 / iwlwifi.conf
Last active December 27, 2015 09:19
/etc/modprobe.d/iwlwifi.confwireless
#13.04
options iwlwifi bt_coex_active=0 11n_disable=1
#14.04
options iwlwifi 11n_disable=8
#11n_disable:disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX (uint)
@user454322
user454322 / tomcat
Created October 30, 2013 09:30
Tomcat script
#!/bin/bash
# description: Tomcat Start Stop Restart
# chkconfig: 345 82 25
export JAVA_HOME="/usr/lib/jvm/java"
export PATH="${JAVA_HOME}/bin:${PATH}"
CATALINA_HOME="/opt/tomcat/tomcat-7.0.47"
case $1 in
start)
/bin/su tomcat -c "${CATALINA_HOME}/bin/startup.sh"
@user454322
user454322 / SSH iptables chain
Created July 25, 2013 02:38
iptables chain to restrict SSH login attempts
#!/bin/sh
#-- Creates a SSH-fal chain
/sbin/iptables -N SSH-fal
#-- Only 3 login attempts can be done from the same IP whithin a minute
/sbin/iptables -A SSH-fal -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH
/sbin/iptables -A SSH-fal -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 2 --rttl --name SSH -j LOG --log-prefix "IPTABLES: failed login attempt"
/sbin/iptables -A SSH-fal -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 3 --rttl --name SSH -j DROP
#!/bin/sh
policy=${HOME}/.jstatd.all.policy
[ -r ${policy} ] || cat >${policy} <<'POLICY'
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
POLICY
jstatd -J-Djava.security.policy=${policy} &