Skip to content

Instantly share code, notes, and snippets.

@6LYTH3
6LYTH3 / iRemetric.py
Last active August 29, 2015 14:06
auto replicate new parametric table
#!/usr/bin/python
import re
pattern = '--'
boxPattern = '/'
container = []
def Main():
with open('out.txt', 'wt') as fout:
@6LYTH3
6LYTH3 / retention.go
Created August 11, 2014 17:07
Simple Data Retention with Go lang
package main
import (
"fmt"
"time"
"strconv"
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
@6LYTH3
6LYTH3 / rsync-abc.sh
Created August 7, 2014 10:20
Script for move file at RuleBase to backup path with 'rsync'
#!/bin/bash
###################################################################
###
### Version Date Author Description
### 0.0.1 7 Jul 2014 Naruedol Y. Initial Script
### Sanit B. move file at RuleBase
### to backup path with 'rsync'
###################################################################
SOURCE=/home/autodiag/MountShareRuleBase/
@6LYTH3
6LYTH3 / iNotify-HB.sh
Last active August 29, 2015 14:04
Monitor the newest file.
#!/bin/bash
SCRIPT=/home/vagrant/repository/bash/iNotify.sh
HB=`ps aux|grep -i inotify.sh|grep -v grep|grep -v Z|wc -l`
if [ $HB -le 0 ]; then
bash $SCRIPT &
fi
@6LYTH3
6LYTH3 / updtET.sh
Created April 15, 2014 16:09
Update ET
#!/bin/bash
PATHDATA="/home/administrator/Data/"
RAWDATA=`ls -rtl --time-style=+"%d-%b-%y:%H:%M:%S" $PATHDATA | sed 1d | awk '{print $6, $NF}'`
for rawdata in $RAWDATA;
do
CHECK=`echo ${rawdata} | awk -F"." '{print $2}'`
if [ -z $CHECK ]
then
@6LYTH3
6LYTH3 / hb-test.py
Last active August 29, 2015 13:59 — forked from takeshixx/hb-test.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@6LYTH3
6LYTH3 / InternetConnection.java
Created April 7, 2014 04:05
Check whether PC is connected to Internet programmatically using java
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
public class InternetConnection {
public static void main(String[] args) throws InterruptedException {
Enumeration<NetworkInterface> interfaces = null;
try {
interfaces = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
#!/bin/bash
# Naruedol Y. 17 Jun 2014 Update Script for jboss6
# Source function library.
. /etc/rc.d/init.d/functions
#JBOSS home directory path.
JBOSS_HOME=/home/jbossadm/jboss6
#JAVA_HOME=/usr/local/java
JAVA_HOME=/usr/java/jdk1.6.0_31
@6LYTH3
6LYTH3 / mysql
Last active August 29, 2015 13:56 — forked from johnantoni/mysql.txt
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
change:
@6LYTH3
6LYTH3 / tmux.md
Created January 25, 2014 15:40 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a