Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile
#!/bin/bash
#2012 [email protected]
#jukebox
rm -f `ls /tmp/jukebox* 2>/dev/null|grep -v "[pP][dD][fF]"`
#...if the very first parameter is a directory then drop in
[ -d "$1" ] && cd "$1" && shift || \
cd "/mnt/files/stuff/music" 2>/dev/null #...OR try out this one
[ "$?" -eq "1" ] && echo "Specified directory does not exist!" && exit 2
format="[mM][pP]3" #other formats might not have to work properly in Totem
#!/bin/bash
#Copyleft (c) 2012 Pavel Jurca <[email protected]>
#!!! LOOK BEFORE YOU LEAP !!!
#this script doesn't rename files/dirs preceding with dots \
#(hidden one's in POSIX)
rm -f /tmp/.summary #remove last log file
cd "/mnt/files/stuff/audio/" 2>/dev/null #here set working folder
[ "$?" == 1 ] && echo "Specified directory does not exist!" && exit 2
#'-maxdepth NUM' determines how many folders in depth in folder's hierarchy \
#set variable depth="" for recursion still deeper down

This is more of a future reference to myself.

My Test incentive is I feel less pressure. Did it pass? Move on :) Did I do wrong? I'll know then.

[Without unit tests] You're not refactoring,

Linux commands

some quick ref

system

uname -a                                      # OS info

cat /etc/*release # OS info

bits #0

Tip: In Raspbian and Ubuntu MATE use ex -v instead of vim to prevent key strokes misdetection.

Ubuntu Mate not showing any icons on a system bar

sudo apt-get install --reinstall xserver-xorg

sudo apt-get install --reinstall xserver-xorg-core

package sortnums.algorithm;
/**
*
* @author pavel jurca, 2012
*/
public class Quicksort {
int[] nums;int i,mid,j;
public Quicksort() {}
package drawing;
import java.awt.*;
import java.util.Random;
import javax.swing.*;
/**
*
* @author pavel jurca, 2014
* @see Bret Victor and his essay on learnable programming
@paveljurca
paveljurca / fileext.bat
Last active November 22, 2017 08:50
signoSign2
@REM ==== CURRENT USER Show file extensions ====
@reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f

Solution down to 69 chars

print +(join "", map {$_->{0}} ({$_%3,"Fizz"},{$_%5,"Buzz"})) || $_,"\n" for 1..100;
perl -E'say+(join"",map{$_-&gt;{0}}({$_%3,"Fizz"},{$_%5,"Buzz"}))||$_ for 1..100'
@echo off
REM Pavel Jurca, xjurp20
:udajeZac
echo %0
echo %date%, %time%
echo .
REM over, ze zadany server existuje
ping -n 1 %1 > debug.txt