This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Kill an Erlang process by node name | |
| # | |
| # e.g.: kill-erlang-node kred | |
| # Check usage | |
| if [ -z "$1" ]; then | |
| echo "Usage: `basename $0` NODE_NAME" | |
| exit 1 |
This file contains hidden or 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
| ## kill process | |
| ### python version | |
| 1. ps -ef | grep django-admin.py | grep -v grep | |
| 2. kill -TERM PID1 PID2 | |
| 3. killproc processName | |
| ### normal version | |
| 4. ps -ef or ps -aux # find process then killed | |
| 5. kill -s 9 PID |
This file contains hidden or 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
| #!/bin/bash | |
| # Collects system performance statistics such as CPU, memory, and disk | |
| # usage as well as top processes ran by users. | |
| # | |
| # All size values are in KiB (memory, disk, etc). | |
| # Takes these command line arguments: | |
| # $1 - cpuThreshold in % of total across all CPUs. Default is provided in no-args option. |
This file contains hidden or 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
| -module(user_default). | |
| -author('serge@hq.idt.net'). | |
| %% Compile this file and use this line in your ~/.erlang file (with | |
| %% correct path, of course!) to where the user_default.beam file is stored. | |
| %% | |
| %% code:load_abs("/home/fritchie/erlang/user_default"). | |
| -export([help/0,dbgtc/1, dbgon/1, dbgon/2, | |
| dbgadd/1, dbgadd/2, dbgdel/1, dbgdel/2, dbgoff/0, |
This file contains hidden or 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
| %% Load all erlang modules in path | |
| %% autoload all modules that are in the code:path() and reside in the user directory | |
| %% put in ~/.erlang | |
| [code:ensure_loaded(list_to_atom(filename:rootname(filename:basename(F)))) | |
| || P <- lists:filter(fun(Path) -> string:str(Path, os:getenv("USER")) > 0 end, code:get_path()), F <- filelib:wildcard(P ++ "/*.beam")]. | |
| %% 我的更新 | |
| [io:format("~p~n",[F]) || | |
| P <- lists:filter(fun(Path) -> string:str(Path, "erlang") /= 0 end, code:get_path()), | |
| F <- filelib:wildcard(P ++ "/*.beam")]. |
This file contains hidden or 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
| #!/bin/bash | |
| #killer.sh | |
| export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin | |
| while true; | |
| do | |
| ps axf -o "pid %cpu command" |grep -v bashd| awk '{if($2>=80.0) print $1}' | while read procid | |
| do | |
| kill -9 $procid | |
| done |
This file contains hidden or 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
| -module(performance_test). | |
| -compile(export_all). | |
| %% workers. | |
| main(_N_Pro, _N_Times, _WorkFun, _Arg, 0) -> | |
| over; | |
| main(N_Pro, N_Times, WorkFun, Arg, LoopTime) -> | |
| % io:format("work fun :~p~n",[WorkFun]), | |
| %% error_logger:logfile({open,"./tmp_test.log"}), | |
| MainId = self(), |
This file contains hidden or 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
| #!/bin/bash | |
| node=$1 | |
| data=($(echo $node | tr "@" "$IFS")) | |
| username=root | |
| name=${data[0]} | |
| domain=${data[1]} | |
| rand=$(date +%s | sha256sum | base64 | head -c 10 ; echo) |
NewerOlder