Skip to content

Instantly share code, notes, and snippets.

@xerrni
xerrni / share.sh
Created Apr 28, 2017
MOUNT DIR SHAREABLE FOLDER
View share.sh
#!/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 Mar 26, 2017
SOE LAB1 ZAD2
View lab1_zad2.sh
#!/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 Mar 26, 2017
SOE LAB1 ZAD1
View lab1_zad1.sh
#!/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 Mar 24, 2017
AISDE LAB 1 ver beta
View lab_1.sh
#!/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 Mar 4, 2017
fix graphs bug quickbox.io
View fixgraphs.sh
#!/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 Feb 9, 2017
VHDL TESTBENCH do zad 18. UCYF 16Z
View testbench.vhdl
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 / libpng_test.c
Created Jan 15, 2016 — forked from niw/libpng_test.c
How to read and write PNG file using libpng. Covers trivial method calls like png_set_filler.
View libpng_test.c
/*
* 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
@xerrni
xerrni / wyswietlacz.ino
Last active Mar 9, 2016
Arduino kod v0.1
View wyswietlacz.ino
#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);