dragonia magazine nr5draco.org.pl/wp-content/uploads/dragonia/dragonia_nr5.pdf · 2017-09-03 ·...
TRANSCRIPT
-
fdisk ścieżka_do_dysku
-
id:3:initdefault:
id:4:initdefault:
c1:1235:respawn:/sbin/aget-
ty 38400 tty1 linux
c1:12345:respawn:/sbin/aget-
ty 38400 tty1 linux
# installpkg kde-i18n-pl-
3.5.4-noarch-1.tgz
$ ./configure
$ make
# make install
# passwd nazwa_uzytkownika
-
$ tar jxvf eagle-usb*
$ cd eagle-usb-2.3.3
$ ./autogen.sh
$ ./configure
$ make
# make install (jako root)
# eagleconfig
# startadsl
# stopadsl
# rm /etc/eagle-us/eagle-
usb_must_be_configured
rc.startadsl
-
emerge sync
emerge -s nazwa
emerge -S nazwa
emerge nazwa_programu
emerge =nazwa_programu-nume-
r_wersji
USE=”flaga1 -flaga2” emerge
nazwa_programu
emerge -p nazwa_programu
emerge -pv nazwa_programu
-
emerge -a nazwa_programu
emerge -u nazwa_programu
emerge -Du nazwa_programu
emerge -C nazwa_programu
emerge depclean
equery files nazwa_pakietu
equery belongs ścieżka_do-
_pliku
equery depgraph nazwa-
_pakietu
equery list nazwa-
_pakietu
equery uses na-
zwa_pakietu
Qpkg
qpkg -I
qpkg -I -v
qpkg -U
qpkg -q
Revdep-rebuild
-
int tab[10];
12.123
12e12
12.24
56.33
1.0987
Średnia wprowadzonych liczb
wynosi = 6e+12
#include
using namespace std;
int main()
{
const int rozmiar = 5; //(1)
double tab[rozmiar]; //(2)
for(int i = 0 ; i < rozmiar ; i++)//(3)
{
cin >> tab[i]; //(4)
}
double suma = 0.0; //(5)
for(int i = 0 ; i < rozmiar ; i++)//(6)
{
suma += tab[i]; //(7)
}
cout
-
Podaj swoje imię : Jan
Podaj swoje nazwisko : Kowal-
ski
Nazywasz się Kowalski Jan
#include
using namespace std;
int main()
{
char imie[20]; //(1)
char nazwisko[40];
cout > imie; //(2)
cout > nazwisko;
cout
-
int tabl[3][4];
char znaki[10][3][7][2];
char tab[3][4];
tab[1][2];
char trzy_litery[3] = {'a',
'b', 'c'}; //(1)
int szesc_cyfr[2][3] = { 1,
2, 3, 4, 5, 6}; //(2)
int szesc_liter[2][3] =
{
//(3)
{'a', 'b', 'c'},
{'d', 'e'},
};
const char imie[] =
"Jan";
//(4)
szesc_cyfr[0][0] otrzyma
wartość 1
szesc_cyfr[0][1] otrzyma
-
wartość 2
szesc_cyfr[0][2] otrzy-
ma wartość 3
itd. ,a
szesc_cyfr[1][2] otrzy-
ma wartość 6
123 + 99 = 222
Podaj dwie liczby:
34
12
Ich suma wynosi : 46
-
void wypisz(char * tekst,
char koniec = '\n');
-
int powi(int liczba, int po-
tega);
doube powd(double liczba,
int potega);
int a = 2, b = 3;
double d = 4.34;
cout
-
entry widget ? opcja war-
tość?
entry .e1
entry .e2 -show *
.e insert end "Jakiś tekst"
.e get
text widget ? opcja war-
tość?
listbox widget ? opcja war-
tość?
.lb insert end pierwszy dru-
gi trzeci .lb get 0 end
scrollbar widget ? opcja war-
tość?
tk_chooseColor ? opcja war-
tość?
-initialcolor kolor
-
-title tytuł_okna
tk_chooseColor -title "Wy-
bierz ulubiony kolor"
tk_chooseColor -initialco-
lor {#c3d4e5}
tk_chooseDirectory ? opcja
wartość?
-initialdir katalog
-mustexist wartość
-title tytuł_okna
tk_chooseDirectory -title
"Wybierz katalog"
tk_dialog widget tytuł tek-
st ikona przyciski etykieta
? etykieta?
etykieta
tk_dialog .a "Quiz" "Czy
wiesz jak masz na imię?" \
question 2 "Tak" "Nie"
"Nie wiem"
tk_getOpenFile ? opcja war-
tość?
-initialdir katalog
-multiple
-defaultextension roz-
szerzenie –
-filetypes wzorzec
-title tytuł_okna
tk_getOpenFile -title
"Otwoz skrypt" \
-filetypes {{Bash {*.sh
*.bash}} {Tcl *.tcl}}
tk_getSaveFile ? opcja war-
tość?
tk_messageBox ? opcja war-
tość?
-title tytuł_okna
-message komunikat
-icon ikona
-type przycisk
abortretryigno-
re, ok, okcancel,
retrycancel, yesno, yesno-
cancel.
tk_messageBox -title
"Potwierdzenie" \
-icon question -type
yesno \
-message "Potwierdz
zakonczenie programu"
tk_optionmenu widget zmien-
na wartość ? wartość?
-
tk_optionMenu .om1 zmienna1
"Opcja A" "Opcja B" "Opcja
C"
tk_optionMenu .om2 zmienna2
"Alfa" "Beta" "Gama" "Delta"
tk_popup widget x y ? in-
deks?
menu .mp
.mp add command -label
"Otwoz" -command
tk_getOpenFile
.mp add command -label
"Zapisz" -command
tk_getSaveFile
.mp add command -label
"Koniec" -command exit
bind . {tk_popup
.mp %X %Y}
menu widget ? opcja war-
tość?
add
command
cascade
checkbutton
radiobutton
separator
-
#!/bin/sh
#the next line restarts using wish \
exec wish "$0" "$@"
# Pierwsza ramka
labelframe .lf1 -text "Text i scrollbar"
text .lf1.t -wrap none -width 25 -height 7\
-xscrollcommand {.lf1.sbx set} \
-yscrollcommand {.lf1.sby set}
scrollbar .lf1.sbx -orient horizontal -command {.lf1.t xview}
scrollbar .lf1.sby -orient vertical -command {.lf1.t yview}
grid .lf1 -row 1 -column 1 -padx 2m -pady 2m
pack .lf1.sbx -side bottom -fill x
pack .lf1.sby -side right -fill y
pack .lf1.t
# Programowe wstawienie tekstu do widgetu
.lf1.t insert end "Zbyt długi tekst i nie mie¶ci się w oknie.
Drugi wiersz
1234567890123456789012345
Czwarty wiersz
Pi±ty wiersz
Szósty wiersz"
# Druga ramka
labelframe .lf2 -text "Entry i Listbox" -width 15
label .lf2.l1 -text "Hasło"
entry .lf2.e -show *
label .lf2.l2 -text "Lista"
listbox .lf2.lb -width 15 -height 3
.lf2.lb insert end {Widget listbox} {Ala i As} trzy
grid .lf2 -row 1 -column 2 -padx 2m -pady 2m -sticky ns
pack .lf2.l1 .lf2.e .lf2.l2 .lf2.lb -padx 1m
# Trzecia ramka
frame .f3 -borderwidth 2 -relief sunken
button .f3.b1 -text "Wy¶wietl tekst" -command {
# pobranie całej zawarto¶ci widget text
tk_messageBox -title "Tre¶ć" \
-message [.lf1.t get 0.0 end]
}
button .f3.b2 -text "Wy¶wietl hasło" -command {
# pobranie zawarto¶ci widget entry
tk_messageBox -title "Hasło" \
-message [.lf2.e get]
}
grid .f3 -row 2 -column 1 -columnspan 2 -padx 2m -pady 2m \
-sticky we
pack .f3.b1 .f3.b2 -side left -padx 1m -pady 1m
# Czwarta ramka
frame .f4 -borderwidth 2 -relief ridge
button .f4.b -text "Koniec" -command exit
grid .f4 -row 3 -column 1 -columnspan 2 -padx 2m -pady 2m \
-sticky we
pack .f4.b
#!/bin/sh
#the next line restarts using wish \
exec tclsh "$0" "$@"
# wywoanie biblioteki graficznej
package require Tk
# tworzenie menu
menu .m
# konfiguracja gornego okna z menu
. configure -menu .m
.m add cascade -label "Plik" -menu .m.plik
.m add cascade -label "Inne" -menu .m.inne
.m add command -label "Pomoc" -command {
tk_messageBox -title "Pomoc" \
-icon info -type ok \
-message "Pomoc jeszcze nie jest dostepna"
}
# zawartosc menu Plik
menu .m.plik
.m.plik add command -label "Otwoz" -command {tk_getOpenFile}
.m.plik add command -label "Zapisz" -command {tk_getSaveFile}
.m.plik add separator
.m.plik add command -label "Koniec" -command exit
# zawartocs menu inne
menu .m.inne
.m.inne add checkbutton -label "Opcja 1" -variable zmienna1
.m.inne add separator
.m.inne add radiobutton -label "Wybierz A" -variable zmienna2
.m.inne add radiobutton -label "Wybierz B" -variable zmienna2
# menu podrozne te sieprzydaje
menu .mp
.mp add command -label "Otwoz" -command tk_getOpenFile
.mp add command -label "Zapisz" -command tk_getSaveFile
.mp add command -label "Koniec" -command exit
bind . {tk_popup .mp %X %Y}
-
plot [-8:10] sin(x**2+1)-
exp(2*x) , “Wykresik funk-
cji”
splot [0:5] [0:5]
sin(sin(x**2)+cos(x**y))
set terminal png small no-
transparent color x0099ff
set output “pliczek.png” ;
splot [0:5] [0:5]
-
sin(sin(x**2)+cos(x**y))
-
1.\documentclass{article}
2.\usepackage[paperhe-
ight=5cm,paperwidth=9cm,hmar-
gin=4mm,
vmargin=4mm]{geometry}
3.\usepackage{iwona}
4.\usepackage{graphicx}
5.\usepackage{polski}
6.\usepackage[latin2]{inpu-
tenc}
7.\usepackage{color}
8.\defineco-
lor{team}{rgb}{.49,.75,.26}
9.\begin{document}
10.\begin{center}
11.\textcolor{team}{\Large
TeaM-TL czyli \TeX{}Live w
LinuxLive}
12.\end{center}
13.\begin{picture}(0,0)
14.\put(65,-52) {\inc-
ludegraphics[height=3.5cm]
{jaszczur}}
15.\end{picture}
16.\vspace{0.6cm}
17.\begin{center}
18.\textcolor{team}{\Large
Monika Czepukojć}
-
19.\vspace{-0.1cm}
20.\textcolor{team}{\small
developer}
21.\vspace{0.4cm}
22.\textcolor{team}{\small
http://team-tl.livenet.pl}
23.\vspace{0.06cm}
24.\hrule width232pt he-
ight0.2pt
25.\vspace{0.09cm}
26.\textcolor{team}{\small
27.\vspace{-0.1cm}
28.\textcolor{team}{\textsc
{\small +48 123 456789}}
29.\end{center}
30.\end{document}
-
root@host:~# installpkg
/root/logsurfer+-1.7-i386-
1.tgz
-
logsurfer@host:~$ su -
Hasło:
root@host:~# tar zxvf /ho-
me/user/logsurfer+-
1.7.tar.gz -C /usr/local/src
root@host:~# tar zxvf /ho-
me/user/postfix-
2.3.3.tar.gz -C /usr/lo-
cal/src
root@host:~# cd /usr/lo-
cal/src/logsurfer+-1.7
root@host:/usr/local/src/log-
surfer+-1.7# ./configure --
prefix=/usr --with-etc-
dir=/etc --sysconfdir=/etc -
-exec-prefix=/usr
root@nelly:/usr/lo-
cal/src/logsurfer+-1.7#
make && make install
root@host:~# removepkg send-
mail-8.13.8-i486-4
root@host:~# removepkg send-
mail-cf-8.13.8-noarch-4
root@host:~# groupadd post-
drop
root@host:~# useradd -s
/dev/null postfix
postfix: fatal: file
/etc/postfix/main.cf: parame-
ters mail_owner and setgi-
d_group: user postfix and
group postdrop have the
same group ID: 102
make: *** [install] Błąd 1
root@host:~# cd /usr/lo-
cal/src/postfix-2.3.3/
root@host:/usr/lo-
cal/src/postfix-2.3.3# make
&& make install
install_root: [/]
tempdir: [/usr/lo-
cal/src/postfix-2.3.3]
config_directory: [/etc/post-
fix]
daemon_directory: [/usr/li-
bexec/postfix]
command_directory:
[/usr/sbin]
queue_directory:
[/var/spool/postfix]
sendmail_path:
[/usr/sbin/sendmail]
newaliases_path:
[/usr/bin/newaliases]
mailq_path: [/usr/bin/mailq]
mail_owner: [postfix]
setgid_group: [postdrop]
html_directory: [no]
manpage_directory: [/usr/lo-
cal/man]
readme_directory: [no]
root@host:~# postfix start
postfix/postfix-script: star-
ting the Postfix mail system
root@host:~# mail
ponia.org
Subject: Test serwera post-
fix.
Pierwsza wiadomosc wyslana
za pomoca serwera postfix.
.
EOT
root@host:~#
root@host:~# postfix stop
postfix/postfix-script:
stopping the Postfix mail
system
root@host:~# rm /root/log-
surfer+-1.7.tar.gz
/root/logsurfer+-1.7-i386-
1.tgz /root/postfix-
2.3.3.tar.gz
root@host:~# vim /etc/log-
surfer.conf
-
root@host:~# su - logsurfer
logsurfer@host:~$ cat
/etc/logsurfer.conf
logsurfer@host:~$ exit
root@host:~# vim
/etc/syslog.conf
auth.info -/var/log/logsur-
fer
root@host:~#
/etc/rc.d/rc.syslog stop
root@host:~#
/etc/rc.d/rc.syslog start
root@host:~# tail -f
/var/log/logsurfer
1 root@host:~# ssh -l root
localhost
2 root@localhost's password:
3 Permission denied, please
try again.
4 root@localhost's password:
5 Last login: Tue Oct 10
17:23:30 2006
6 Linux 2.4.33.3.
7 root@host:~#
Oct 10 21:04:07 host
sshd[16439]: Failed pas-
sword for root from
127.0.0.1 port 33120 ssh2
Oct 10 21:04:30 host
sshd[16439]: Accepted pas-
sword for root from
127.0.0.1 port 33120 ssh2
root@host:~# su - logsurfer
logsurfer@host:~$ mkdir -p
/home/logsurfer/scripts/log-
surfer_mails
logsurfer@host:~$ vim /ho-
me/logsurfer/scripts/logsur-
fer_mails/ssh_accepted.sh
logsurfer@host:~$ vim /ho-
me/logsurfer/scripts/logsur-
fer_mails/ssh_failed.sh
root@host:~# chmod 700 /ho-
me/logsurfer/scripts/logsur-
fer_mails/ssh_accepted.sh
root@host:~# chmod 700 /ho-
me/logsurfer/scripts/logsur-
fer_mails/ssh_failed.sh
root@host:~# vim /home/log-
surfer/scripts/logsurfe-
r_mails/ssh_accepted
root@host:~# vim /home/log-
surfer/scripts/logsurfe-
r_mails/ssh_failed
root@host:~# postfix start
root@host:~# su - logsurfer
logsurfer@host:~$ logsurfer
-c /etc/logsurfer.conf -f
/var/log/logsurfer 2>&1 &
root@host:~# tail -f
/var/log/logsurfer
/var/log/maillog
root@host:~# ssh -l root lo-
calhost
-
##################
# logsurfer.conf #
##################
'([^ ]+) sshd\[[0-9]*\]: Accepted ([^ ]+)' - - - 0 continue exec "/home/logsurfer/scripts/logsurfer_mails/ssh_accepted.sh \"$0\""
'([^ ]+) sshd\[[0-9]*\]: Accepted ([^ ]+)' - - - 0 continue exec "/bin/echo $0"
'([^ ]+) sshd\[[0-9]*\]: Failed ([^ ]+)' - - - 0 continue exec "/home/logsurfer/scripts/logsurfer_mails/ssh_failed.sh \"$0\""
'([^ ]+) sshd\[[0-9]*\]: Failed ([^ ]+)' - - - 0 continue exec "/bin/echo $0"
#!/bin/sh
###################
# ssh_accepted.sh #
###################
if [ -z "$1" ] ; then
echo "Usage: command parameter."
exit 1
fi
cp /root/scripts/logsurfer_mails/ssh_accepted /tmp
echo "$1">>/tmp/ssh_accepted
/usr/sbin/sendmail user@host, user1@host>/tmp/ssh_failed
/usr/sbin/sendmail user@host, user1@host
-
To: user@host,user1@host
From: logsurfer@host
Subject: Pomyslna proba logowania!!!
QContent-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Poprawne haslo, udane logowanie lub proba wlamania!!!
Informacja z logow systemowych:
To: user@host,user1@host
From: logsurfer@host
Subject: Pomyslna proba logowania!!!
QContent-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Poprawne haslo, udane logowanie lub proba wlamania!!!
Informacja z logow systemowych:
-
AutoIndex
Options -Indexes
AddAlt
AddAlt
tytuł *.gz *.pdf
AddAltByType “TEKST”
text/html
DefaultIcon /icons/x.xbm
AddDescrip-
tion “Super tajny plik”
/var/www/htdocs/x/y.html
He-
aderName helo.html
Readme-
Name readme.html
IndexIgnore *~ *.bak .*
IndexOptions
-
./configure && make && make
install
./configure –with-language=
./configure --with-gdlib=