Skip to content

Instantly share code, notes, and snippets.

View TheIndifferent's full-sized avatar

Stanislav Baiduzhyi TheIndifferent

View GitHub Profile
#!/bin/bash
function max_number() {
echo $(( $1 > $2 ? $1 : $2 ))
}
function trim_line_breaks() {
tr -d '\n'
}
@TheIndifferent
TheIndifferent / docker-clean-all
Created July 1, 2016 10:27
Bash script to stop and delete all the docker containers and remove all the images
#!/bin/bash
echo 'stopping containers...'
while [[ -n "$( docker ps -a -q )" ]]
do
docker stop $(docker ps -a -q)
done
echo 'deleting containers...'
if [[ -n "$( docker ps -a -q )" ]] ; then
docker rm $(docker ps -a -q)
fi
import java.awt.Font;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;
public class MinimalLabel implements Runnable {
public static void main(String[] args) {
SwingUtilities.invokeLater(new MinimalLabel());
top - 22:28:13 up 0 min, 0 users, load average: 0.56, 0.13, 0.04
Tasks: 142 total, 1 running, 141 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.7 us, 5.0 sy, 0.0 ni, 92.5 id, 0.8 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 10061420 total, 168180 used, 9893240 free, 2240 buffers
KiB Swap: 15728636 total, 0 used, 15728636 free. 75196 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
782 root 20 0 22144 2496 2188 R 6.250 0.025 0:00.01 top
1 root 20 0 35956 5900 3568 S 0.000 0.059 0:02.03 systemd
2 root 20 0 0 0 0 S 0.000 0.000 0:00.00 kthreadd
@TheIndifferent
TheIndifferent / jtreg-jenkins-build-original.sh
Created May 18, 2015 09:07
jtreg-jenkins-build-original.sh
#!/bin/bash
function copyJCovJars() {
Downloading JCov to $WORKSPACE folder
tempDirJCov=jcov
rm -fr $tempDirJCov
mkdir -p $tempDirJCov/lib
#cd ../jcov/JCOV_BUILD/jcov_2.0
@TheIndifferent
TheIndifferent / jtreg-jenkins-build.sh
Last active August 29, 2015 14:21
jtreg jenkins build script
#!/bin/sh
readonly TIP_VERSION='4.2.0'
function checkWorkspaceVar()
{
echo 'Checking "$WORKSPACE" variable...'
if [ -z "$WORKSPACE" ] ; then
echo -n 'WORKSPACE variable is empty, setting to current dir: '