This file contains 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
@ECHO OFF | |
FOR /F "tokens=7 delims=: " %%G in ('netstat -ano ^| findstr 48823') DO SET PID=%%G | |
IF [%PID%]==[] (goto kill_pid) ELSE (ECHO "A process is already running with the ID: " %PID% && goto check_status) | |
:kill_pid | |
for /f "usebackq tokens=1" %%A in (`wmic process where "CommandLine like '%%ABC_PROCESS%%'" get ProcessId`) do taskkill /f /PID %%A | |
ECHO %DATE% %TIME% ABC_PROCESS process restarted >> RESET_LOG.txt | |
goto start_new | |
goto:eof |
This file contains 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
ssh username@your_server_ip | |
sudo apt-get update | |
sudo apt-get install xrdp | |
sudo apt-get install xfce4 | |
#Optional | |
sudo apt-get install xfce4-terminal | |
sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n xfce-session \n' /etc/xrdp/startwm.sh | |
sudo adduser xrdp ssl-cert | |
sudo adduser 'username' ssl-cert | |
sudo ufw allow 3389/tcp |
This file contains 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
@ECHO ON | |
FOR /F "tokens=5" %%T IN ('netstat -a -n -o ^| findstr ":8081" ') DO ( | |
SET /A ProcessId=%%T) | |
If not defined ProcessId (call 8081.bat) else (echo %date% %time% AlreadyRunning PID %ProcessId%) |
This file contains 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
SELECT * | |
FROM tree t, item m | |
WHERE M.ID = RT.PARENTID | |
CONNECT BY PRIOR t.parentid = t.childid | |
START WITH t.chilid = 123456789 | |
ORDER BY T.PARENTID |
This file contains 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
for %%i in (*.txt) do ( | |
echo %%i %%~z%i | |
if %%~z%i LSS 1 ( | |
echo.move %%i | |
move "%%i" "C:\EmptyFiles\%%i" | |
) | |
) |
This file contains 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
myApp.directive('onEnter', function () { | |
return function (scope, element, attrs) { | |
element.bind("keydown keypress", function (event) { | |
if (event.which === 13) { | |
scope.$apply(function () { | |
scope.$eval(attrs.onEnter); | |
}); | |
event.preventDefault(); |
This file contains 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
myApp.filter('escapeHtml', function () { | |
var entityMap = { | |
"&": "&", | |
"<": "<", | |
">": ">", | |
'"': '"', | |
"'": ''', | |
"/": '/' | |
}; |