| -b filename | Block special file |
| -c filename | Special character file |
| -d directoryname | Check for directory existence |
| -e filename | Check for file existence |
| -f filename | Check for regular file existence not a directory |
| -G filename | Check if file exists and is owned by effective group ID. |
| -g filename | true if file exists and is set-group-id. |
| -k filename | Sticky bit |
| -L filename | Symbolic link |
| -O filename | True if file exists and is owned by the effective user id. |
| -r filename | Check if file is a readable |
| -S filename | Check if file is socket |
| -s filename | Check if file is nonzero size |
| -u filename | Check if file set-ser-id bit is set |
| -w filename | Check if file is writable |
| -x filename | Check if file is executable |
Belekas
Viskas kas nepatenka i kitas kategorijas
Video: Atviras kodas bei jo svarba nūdienos visuomenėje
Prezentacija: Atviras kodas bei jo svarba nūdienos visuomenėje
Prezentacija (Atviras kodas bei jo svarba nūdienos visuomenėje) su public RW teisėmis

Atviras kodas bei jo svarba nudienos visuomeneje by Ruslanas Gžibovskis is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at lpic.lt.
Permissions beyond the scope of this license may be available at http://lpic.lt/2012/03/10/atviras-kodas-bei-jo-svarba-nudienos-visuomeneje/.
Sveiki, nusprendžiau pasidalinti, savo mikro sąrašiuku, kiniškų el. parduotuvių:
Sveiki, radau toki straipsniuką, kur išrašyti visi meta htmltag’o parametriukai.
| Atributas | Šaltinis | Apibūdinimas |
|---|---|---|
| Allow | rfc1945 | Gives allowed http methods |
| Alternates | rfc2068 | List alternate representations |
| Bulletin-Date | Lotus | Date, e.g. 1997-03-24 15:57 |
| Bulletin-Text | Lotus | Document description |
| Cache-Control | rfc2068 | Directives to cacheing mechanisms |
| Content-Base | rfc2068 | Specify base URL for entity |
| Content-Disposition | rfc2183 | Specify content handler (Microsoft) |
| Content-Encoding | rfc1945 | Gives compression scheme |
| Content-language | rfc1945 | Natural Language of document |
| Content-Length | rfc1945 | Size of body in bytes |
| Content-Location | rfc2068 | Resource location for entity |
| Content-MD5 | rfc2068 | MD5 digest of entity body |
| Content-Range | rfc2068 | Range of partial response |
| Content-Script-Type | html40 | Specifies default scripting language |
| Content-Style-Type | html40 | Specifies default style sheet language |
| Content-Type | rfc1945 | Media type |
| Content-type | rfc1945 | |
| Content-Version | rfc2068 | Version tag of evolving entity |
| Date | rfc1945 | Date message originated (HTTP format) |
| Default-Style | html40 | Set preferred style sheet |
| Derived-From | rfc2068 | Version tag of previous version |
| ETag | rfc2068 | Entity tag for resource identification |
| Expires | rfc1945 | Expiry date of document (HTTP date format) |
| Ext-cache | Netscape | Alternate cache path |
| Instance-Delegate | SHOE | Pointer to Ontology Key |
| Instance-Key | SHOE | Ontology Key |
| Last-Modified | rfc1945 | Date resource was last changed |
| Link | rfc1945 | Relationship to other resources |
| Location | rfc1945 | URL of resource |
| MIME-Version | rfc1945 | May indicate MIME-compliance. Ignore. |
| Page-Enter | MSIE 4 | Sets page entry transistion |
| Page-Exit | MSIE 4 | Sets page exit transistion |
| PICS-Label | PICS | Document content labelling |
| Pragma | rfc1945 | no-cache prevents cacheing |
| Public | rfc2068 | List of supported methods by server |
| Range | rfc2068 | Specify subrange (bytes) |
| Refresh | Netscape | Delay till browser reloads (optional URL) |
| Server | rfc1945 | Gives information about server |
| Set-Cookie | Netscape | Sets cookie value |
| Site-Enter | MSIE 4 | Sets site entry transistion |
| Site-Exit | MSIE 4 | Sets site exit transistion |
| Title | rfc1945 | Title of entity (obsoleted in rfc2068) |
| Transfer-Encoding | rfc2068 | Specify transfer (cf. entity) encoding |
| URI | rfc1945 | URIs by which resource is located. (obsoleted in rfc2068) |
| Vary | rfc2068 | Specify that request was selected from alternates (e.g. different languages) |
| Via | rfc2068 | Generated by gateways |
| Warning | rfc2068 | Warning about cache problems, etc. |
| Window-target | Netscape | Specify target window of current document |
he he
atsinaujino http://ip.lpic.lt dizainas!
Original
– čia pateikiamas tik vertimas!
Jei norite leisti prisijungti root naudotojui per SSH tik iš vieno IP, o kitiems naudotojams iš betkur kitur. Tokį sprendimą galime realizuoti per PAM autentifikacijos modulius. Naudosime pam_access PAM modulį, kuris naudojamas prieigos valdymui. Šis suteikia galimybę kontroliuoti prisijungimus atsižvelgiant į:
- Naudotojo prisijungimo vardą (Login names)
- Kompą ar domeną (Host or domain names)
- IP ar IP tinklas (Internet addresses or network IP numbers)
- Terminal line names etc
Kam naudojam pam_access?
Prie serverio gali reikėti prisijungti iš betkurio tinkle esančio kompiuterio. taigi turime pasirūpinti gera prieigos kontrole, naudojant OpenSSH servisą.
Kaip susikonfiguruoti pam_access?
Reikės keisti šiuos failiukus:
- /etc/pam.d/sshd
- /etc/security/access.conf
Linux PAM konfiguracinis failas.
Taisyklių paėmimui pagal nutylėjimą yra naudojamas šis failas.
Kai kasnors jungiasi, perbėgama per 2 bylos turinį ir jei yra sutapimas įvykdoma taisyklė. Mes galime nurodyti, ar priimti tokį prisijungimą ar atmesti. sintaksė: permission : username: origins kur:
permission : Teisių laukelis “+” (prieiga suteikiama) ar “-” (prieiga atšaukiama)
username : Linux sisteminis naudotojas (username)/login‘as (root ir kiti). Galima nurodyti ir grupės vardą. Arba galima nurodyti specialų trumpinį: ALL (Jei norime, kad tai būtų skirta visiems).
origins : Čia pateikiamas sąrašas terminalo langų, kompo vardų, IP adresų, domenų, kurie prasideda . ar specialų trumpinį ALL ar LOCAL
Visų pirma, kad tolesni pakeitimai veiktų reikia įjungti pam_access palaikymą byloje /etc/pam.d/sshd:
# vi /etc/pam.d/sshd
# Papildome eilute:
account required pam_access.so
Išsaugome ir uždarome.
Tarkime norime leisti naudotojam root ir lpic prisijungti tik iš IP adreso 1.1.1.1.
Atidarome bylą: /etc/security/access.conf su root’o teisėmis:
# vi /etc/security/access.conf
# Papildome eilute:
-: ALL EXCEPT root lpic:1.1.1.1
Išsaugome bylą.
Dabar SSH leis prisijungimus naudotojų root ir lpic tik iš 1.1.1.1 IP adreso. Jei naudotojas root ir lpic bandys jungtis iš kito IP adreso, jiems parašys: ‘Connection closed by xxx.xxx.xxx.xxx’ ir error pranešimu turėtų būti papildytas Jūsų žurnaliukas (log’as):
# tailf /var/log/message
Feb 20 19:02:39 hostname pam_access[2091]: access denied for user `lpic' from `xxx.xxx.xxx.xxx'Kur, jau kaip ir minėjau xxx.xxx.xxx.xxx ≠ 1.1.1.1.
Beje, jei įrašėte savo naudotojo vardą ir išsaugojote… VISOS TAISYKLĖS taikomos IŠKART po IŠSAUGOJIMO /etc/security/access.conf bylos! Būkite atsargūs!
Daugiau pavyzdukų:
a) Kartais reiktų sukurti taisykles, kurios leistų prisijungti visiems išskyrus root iš betkur, o root tik iš localhost:
-:root:ALL EXCEPT LOCAL
# ar
-:root:ALL EXCEPT localhostb) Deny network and local login to all users except for user root and vivek:
-:ALL EXCEPT root vivek:ALL
c) Tik iš 192.168.1.0/24 leisti prisijungti root naudotoju:
+ : root : 192.168.1.0/24Pastebėjimas: taip galime leisti ir drausti jungtis visoms tarnyboms, kurios naudoja PAM, pvz.: ftpd, telnet ir t.t.
P.S. + : root : yyy.yyy.yyy.yyy
- : root : ALL
Sveiki,
norėdami įdiegti Solaris 10u9 mdb programėlę susidiekime SUNWmdb ir SUNWmdbr paketus. Visų pirma prijunkime CD.ISO, kas gali būti atlikta tik iš globalios zonos (Jei nenaudojate konteinerių, tai galėjote pabraukto teksto ir neskaityti
):
lofiadm -a /tmp/software.iso /dev/lofi/1
mount -F hsfs -o ro /dev/lofi/1 /mnt
Pereikim į mum reikiamą aplanką
cd /mnt/Solaris_10/Product
Susimeskim visą tai:
pkgadd -d . SUNWmdb
pkgadd -d . SUNWmdbr
Toliau beliko arba prisijungti (ir sustabdyti) procesą: mdb -p ĖPID arba atidaryti core/dump failą: mdb core_dump
Na va o daba mdb komandos:
- Control Commands
- Input & Output Commands
- Format Specifications
- System Examination
- Target Examination
- Tracing, Watchpoints & Breakpoints
- General Debugging
| Control Commands | |
|---|---|
$< or $<< |
Replace input with a macro or source a macro. |
$>filename or::log filename |
Log session to a file. If no filename, use default. |
| |
Pipe. Allows simple commands to be joined. |
! |
Shell escape. Acts as a pipe to a shell command. (Not available in kmdb.) |
// |
Comment. Following words on the same line are ignored. |
$M |
Show built-in macros (Kernel debugger only). |
$Pstring |
Set prompt to string. |
$Q::quit |
Quit. (From kmdb, use -u option to avoid exiting to ok> prompt.) |
$W |
Re-open target in writable mode. |
$p |
Change target context. |
$w |
Control output page width. |
:A |
Attach to a process or core file. |
:R |
Release attachment. |
:k |
Kill and release targets. |
$v |
Print non-zero variables. |
>::typeset |
Assign a variable. |
::dcmds |
Print available commands. |
::nm |
Print symbol table. (-P specifies a private symbol table. Manipulated with ::nmaddand ::nmdelete |
::help dcmd |
Provide usage notes on a dcmd. |
::typeset |
Manipulate variable. |
::walk |
Walk data structure. |
::walkers |
List available walkers. |
| Input & Output Commands | |
|---|---|
$< $<< |
Replace input with a macro or source a macro. |
$>filename |
Log session to a file. If no filename, use default. |
address/format-spec/format-spec |
Read the value in a memory addressformatted as format-spec. If no address is provided, use dot. |
address/W value |
Write the value in the four bytes starting with address. If no address is provided, usedot. v, w or Z may also be used instead of Wto write 1, 2 or 8 bytes, respectively. |
address=format-spec=format-spec |
Format immediate value of address or dot. |
? |
Read/write primary object file. |
@format-spec |
Read/write physical address as format-spec. |
\format-spec |
Read/write physical address as format-spec. |
The difference between / and = is subtle. For example, to find the address holding the value of the maxphys symbol in decimal, we would run:
maxphys=D
To find the value inside the above address, we would use / like:
maxphys/D
| General Debugging | |
|---|---|
$G |
Toggle C++ demangling. |
$V |
Toggle disassembly mode. |
$g |
Toggle C++ demangling. |
address::dis |
Disassemble text starting at address. |
| Comparison Operators | |
|---|---|
== |
Logical equality. |
!= |
Logical inequality. |
& |
Bitwise AND. |
| |
Bitwise OR. |
^ |
Bitwise XOR. |
Sveiki, turiu darbo, taiatsiranda laiko parašyt skriptukus, nusprendžiau vienu jų pasidalinti.
Pasirašiau 88×31 uptime baneriuką: .
$uptime=shell_exec ("cat /proc/uptime | awk '{print $1}'");
function getTime ($unix_laikas) {
if ($unix_laikas<60) {
$returnas=intval($unix_laikas);
if ($returnas<10) {$returnas="0".$returnas;} return $returnas."!";
} elseif (60<=$unix_laikas && $unix_laikas<3600) {
$returnas=intval($unix_laikas/60);
if ($returnas<10) {$returnas="0".$returnas;} return $returnas;
} elseif (3600<=$unix_laikas && $unix_laikas < 86400) {
$returnas=intval($unix_laikas/3600);
if ($returnas<10) {$returnas="0".$returnas;} return $returnas;
} else {
return intval($unix_laikas/86400);
}
}
function uptime ($s0, $s1, $s2) {
$iwidth=88; $iheight=31;
// create a true colour, transparent image
// turn blending OFF and draw a background rectangle in our transparent colour
$image=imagecreatetruecolor($iwidth,$iheight);
imagealphablending($image,false);
$col=imagecolorallocatealpha($image,255,255,255,127);
imagefilledrectangle($image,0,0,$iwidth,$iheight,$col);
imagealphablending($image,true);
// Alpha blanding is back on.
// insert image manipulation stuff in here
$font=3;
$red=imagecolorallocatealpha($image,0,0,0,0);
imagestring($image, $font, 1, 0, $s0, $red);
imagestring($image, $font, 1, 9, $s1, $red);
imagestring($image, $font, 1, 20, $s2, $red);
// output the results...
header("Content-Type: image/png;");
imagealphablending($image,false);
imagesavealpha($image,true);
imagepng($image);
}
if ($uptime<60) { // Sekundes
$s1="up 0 days";
$s2="00:00:".getTime($uptime);
} elseif (60<=$uptime && $uptime<3600) { // Minutes
$tmp=getTime($uptime);
$s1="up 0 days";
$s2="00:".$tmp.":".getTime($uptime-($tmp*60));
} elseif (3600<=$uptime && $uptime<86400) { // Valandos
$tmp=getTime($uptime);
$s1="up 0 days";
$s2=$tmp.":";
$uptime-=$tmp*3600;
$tmp=getTime($uptime);
$s2.=$tmp.":".getTime($uptime-($tmp*60));
} else {
$tmp=getTime($uptime);
$s1="up ".$tmp ." days";
$uptime-=$tmp*86400;
$tmp=getTime($uptime);
$s2=$tmp.":";
$uptime-=$tmp*3600;
$tmp=getTime($uptime);
$s2.=$tmp.":".getTime($uptime-($tmp*60));
}
$s0=shell_exec("hostname -d");
$s0=substr($s0, 0, strlen($s0)-1);
uptime ($s0, $s1, $s2);
?>
Jeigu turite idėjų, kaip visą tai atnaujinti brūkūtelėkite.