Skip to content

Instantly share code, notes, and snippets.

@xerrni
xerrni / share.sh
Created April 28, 2017 00:39
MOUNT DIR SHAREABLE FOLDER
#!/bin/bash
user_list=( usr_1 usr_2 usr_3 ) #add users to this array
dst="share_name" #name of sherable dir
src="" #source dir e.g. /dir/to/share
group_name="__no_usr__" #unix group name, if not set group_name="usr_name"
if [ "$src" == "" ]
then
echo "edit source directory"
exit 10
@xerrni
xerrni / lab1_zad2.sh
Last active March 26, 2017 21:53
SOE LAB1 ZAD2
#!/bin/bash
help="Poprawne użycie:\narg1 - wyrazenie\narg2 - rozszerzenie pliku\narg3 - katalog, w ktorym skrypt bedzie szukal pliku okreslonego typu."
if [ "$#" -ne 3 ]; then
echo "podaj 3 argumenty"
echo -e $help
exit 1
fi
if [ ! -d "$3" ]; then
@xerrni
xerrni / lab1_zad1.sh
Last active March 26, 2017 20:50
SOE LAB1 ZAD1
#!/bin/bash
help="Poprawne użycie:\narg1 - katalog, w ktorym skrypt bedzie zliczal pliki okreslonego typu.\narg2 - typ_pliku"
argumenty="zwykly - zwykle pliki\nFIFO - FIFO\nblok - pliki specjalne blokowe\nznak - pliki specjalne znakowe\nsocket - sockety\ndowiazanie - dowiazania symboliczne\nkatalog - katalogi"
if [ "$#" -ne 2 ]; then
echo "podaj 2 argumenty"
echo -e $help
echo -e $argumenty
exit 1
fi
@xerrni
xerrni / lab_1.sh
Last active March 24, 2017 21:50
AISDE LAB 1 ver beta
#!/bin/bash
alg1="1"
alg2="2"
alg3="4"
figura1="recv.cif"
figura2="rech.cif"
fname1="${figura1}__alg__${alg1}__.txt"
fname2="${figura1}__alg__${alg2}__.txt"
fname3="${fugura1}__alg__${alg3}__.txt"
fname4="${figura2}__alg__${alg1}__.txt"
@xerrni
xerrni / fixgraphs.sh
Last active March 4, 2017 23:06
fix graphs bug quickbox.io
#!/bin/bash
src1="/srv/rutorrent/home/widgets"
src2="/srv/rutorrent/home/inc"
cdir=$(pwd)
cd ${src1}
if [ $? -ne 0 ] # checking if command executed successfully
then
echo "Can\`t cd into ${src1}"
exit 1
@xerrni
xerrni / testbench.vhdl
Created February 9, 2017 18:08
VHDL TESTBENCH do zad 18. UCYF 16Z
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity tb is
end tb;
architecture arch of tb is
component kolokwium
port (clk,set: in bit; wy: out bit);
end component;
@xerrni
xerrni / wyswietlacz.ino
Last active March 9, 2016 11:43
Arduino kod v0.1
#include <LiquidCrystal.h>
int tab[4]={1,6,9,0},value=0,previousvalue=1;
int led = 13,novalue=1,zero=0;
//31 34 35 42 ++++++++++
// 32 33 36 - 41 -------
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
Serial.begin(9600);
@xerrni
xerrni / libpng_test.c
Created January 15, 2016 21:29 — forked from niw/libpng_test.c
How to read and write PNG file using libpng. Covers trivial method calls like png_set_filler.
/*
* A simple libpng example program
* http://zarb.org/~gc/html/libpng.html
*
* Modified by Yoshimasa Niwa to make it much simpler
* and support all defined color_type.
*
* To build, use the next instruction on OS X.
* $ brew install libpng
* $ clang -lz -lpng15 libpng_test.c