Skip to content

Instantly share code, notes, and snippets.

Prut Udomwattawee apzentral

Block or report user

Report or block apzentral

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
@apzentral
apzentral / check-process.sh
Created Jul 6, 2019
Bash: Script to Monitor Process. If not running will start it.
View check-process.sh
#!/bin/bash
####################
#
# Script: Checking process and if it is not running will start that process
#
####################
#*** CONFIG ***
@apzentral
apzentral / starting-script-jupyter.py
Last active Apr 15, 2019
Python: starting script for Jupyter
View starting-script-jupyter.py
# Jupyter
import os
import sys
import inspect
import re
import pprint
import json
import traceback
import pandas as pd
@apzentral
apzentral / bash-remove-old-kernels.sh
Created Jul 11, 2018
Bash one-liner to delete only old kernels
View bash-remove-old-kernels.sh
dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2) | xargs sudo apt-get -y purge
@apzentral
apzentral / .aliases
Last active Jul 26, 2019
.aliases file
View .aliases
###################################
# Utilities
###################################
alias b="brew"
alias c="clear"
alias e="exit"
alias s="sudo su"
alias n="node"
alias p="php"
View ant-sshexec-build.xml
<!-- Build Script for ANT -->
<project basedir="." default="" name="Build Script">
<property name="username" value="username"/>
<property name="passwd" value="passwd"/>
<property name="applicationFolder" value="/var/www/html/"/>
<property name="sandboxRoot" value="${basedir}"/>
<property name="development-host" value="host"/>
<property name="production-host" value="host"/>
@apzentral
apzentral / starting-script.py
Last active May 30, 2018
Python: starting script
View starting-script.py
# -*- coding: utf-8 -*-
"""
Summary:
"""
import os
import sys
import inspect
CURRENT_FILE_NAME = inspect.getfile(inspect.currentframe())
@apzentral
apzentral / ant-scp-build.xml
Last active Jan 18, 2019
ANT: scp template
View ant-scp-build.xml
<!-- Build Script for ANT -->
<project basedir="." default="" name="Build Script">
<property name="username" value="username"/>
<property name="passwd" value="passwd"/>
<property name="keyfile-path" value="/path-to-private-key"/>
<property name="applicationFolder" value="/var/www/html/"/>
<property name="sandboxRoot" value="${basedir}"/>
<property name="development" value="${username}:${passwd}@server:${applicationFolder}"/>
@apzentral
apzentral / component-es6.js
Last active Jan 16, 2018
ReactJS: Skeleton for React component in ES6
View component-es6.js
import React, { Component } from "react";
// Component
class ComponentClass extends Component {
constructor(props) {
super(props);
this.state = {};
}
@apzentral
apzentral / store.js
Last active Aug 29, 2015
ReactJS: Skeleton for Store
View store.js
/**
* Your Store
*/
'use strict';
/**
* Libraries
*/
var AppDispatcher = require('../dispatcher/AppDispatcher');
var EventEmitter = require('events').EventEmitter;
@apzentral
apzentral / component.js
Last active Jan 1, 2018
ReactJS: Skeleton for React component
View component.js
/**
* @jsx React.DOM
*/
'use strict';
/**
* Libraries
*/
var React = require('react');
You can’t perform that action at this time.