PyPy (Wikipedie), tj. implementace Pythonu v RPythonu, alternativa CPythonu v C, byla vydána v nové major verzi 8.0.0. Podporuje Python 2.7, 3.11 a 3.12.
V jádře Linux byly nalezeny a v upstremu ve verzích 5.10.270, 5.15.221, 6.1.188, 6.6.157, 6.12.109, 6.18.50 a 7.2.4 již opraveny 4 kritické zranitelnosti umožňující eskalaci práv: DirtyAH6 (CVE-2026-80844), TUNderflow (CVE-2026-81000), PPPoEject (CVE-2026-68121) a DiagSpill (CVE-2026-74469).
Německá policie a celníci zneužívají ke čtení zpráv komunikačních aplikacích WhatsApp, Signal, Telegram nebo Threema velice jednoduchý trik, který nevyžaduje prolomení šifrování, spear phishing, odposlech SMS či jinou technicky náročnou metodu. Příslušníkům státního aparátu pouze stačí získat krátký přístup k odemčenému telefonu a prostřednictvím QR kódu propojit účet s oficiální desktopovou nebo webovou aplikací v policejním
… více »Počítačová hra Factorio (Wikipedie) nově běží nativně na ARM64 Linuxu a headsetu Steam Frame.
Fugleramme, v překladu 'ptačí rámeček', je open-source projekt postavený na Raspberry Pi, který pomocí lokální umělé inteligence BirdNET-Go rozpoznává ptačí druhy podle jejich zpěvu a na displeji následně zobrazuje koláž tvořenou odpovídajícími ilustracemi. Databáze obsahuje přes 800 ručně vybraných historických přírodovědných ilustrací více než 400 druhů ptáků.
… více »Unicode Consortium, nezisková organizace koordinující rozvoj standardu Unicode, oznámila vydání Unicode 18.0. Přidáno bylo 13 007 nových znaků. Celkově jich je 172 808. Přibylo 9 nových Emoji.
Nové číslo časopisu Raspberry Pi zdarma ke čtení: Raspberry Pi Official Magazine 169 (pdf).
Byla vydána nová verze 6.4 programovacího jazyka Swift (Wikipedie). Zdrojové kódy jsou k dispozici na GitHubu.
Německý kancléř Friedrich Merz (CDU) se během debaty s finalisty studentské vědecké soutěže Jugend forscht vyjádřil pro konec anonymity na internetu a vyslovil názor, že pro uživatele Internetu by měla platit podobná právní odpovědnost jako pro novináře tradičních médií. Na dotaz studenta, jak by se tedy povinnost uvádět pravé jméno slučovala s prací investigativních novinářů nebo ochranou jejich zdrojů, Merz neodpověděl, ve své
… více »
#define EVENT_SIZE ( sizeof (struct inotify_event) )
#define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )
int main(int argc, char **argv)
{
int length, i = 0;
int fd;
int wd;
char buffer[BUF_LEN];
fd = inotify_init();
if (fd < 0) {
perror("inotify_init");
}
wd = inotify_add_watch(fd, "/home/tomesh/Dropbox/C/sync", IN_ALL_EVENTS);
if (length < 0) {
perror("read");
}
while (1) {
length = read(fd, buffer, BUF_LEN);
struct inotify_event *event = (struct inotify_event *) &buffer[ i ];
if (event->len) {
if (event->mask & IN_CREATE) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was created.\n", event->name);
} else {
printf("The file %s was created.\n", event->name);
}
}
if (event->mask & IN_DELETE) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was deleted.\n", event->name);
} else {
printf("The file %s was deleted.\n", event->name);
}
}
if (event->mask & IN_MODIFY) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was modified.\n", event->name);
} else {
printf("The file %s was modified.\n", event->name);
}
}
if (event->mask & IN_MOVED_FROM) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was moved from.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was moved from.\n", event->name, event->cookie);
}
}
if (event->mask & IN_MOVED_TO) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was moved to.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was moved to.\n", event->name, event->cookie);
}
}
if (event->mask & IN_MOVE_SELF) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %ds was itself moved.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was itself moved.\n", event->name, event->cookie);
}
}
if (event->mask & IN_DELETE_SELF) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was itself deleted.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was itself deleted.\n", event->name, event->cookie);
}
}
if (event->mask & IN_OPEN) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was opened.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was opened.\n", event->name, event->cookie);
}
}
if (event->mask & IN_ATTRIB) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d attr was changed.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d attr was changed.\n", event->name, event->cookie);
}
}
if (event->mask & IN_ACCESS) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was accessed.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was accessed.\n", event->name, event->cookie);
}
}
}
}
(void) inotify_rm_watch(fd, wd[0]);
(void) close(fd);
exit(0);
}
Řešení dotazu:
i += EVENT_SIZE + event->len;
#define EVENT_SIZE ( sizeof (struct inotify_event) )
#define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )
int main(int argc, char **argv)
{
int length, i;
int fd;
int wd;
char buffer[BUF_LEN];
struct inotify_event *event;
fd = inotify_init();
if (fd < 0)
perror("inotify_init");
wd = inotify_add_watch(fd, "/home/tomesh/Dropbox/C/sync", IN_ALL_EVENTS);
while (1) {
i = 0;
length = read(fd, buffer, BUF_LEN);
if (length < 0)
perror("read");
if (length == 0)
sleep(1);
while (i < length) {
event = (struct inotify_event *) &buffer[i];
if (event->mask & IN_CREATE) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was created.\n", event->name);
} else {
printf("The file %s was created.\n", event->name);
}
}
if (event->mask & IN_DELETE) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was deleted.\n", event->name);
} else {
printf("The file %s was deleted.\n", event->name);
}
}
if (event->mask & IN_MODIFY) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was modified.\n", event->name);
} else {
printf("The file %s was modified.\n", event->name);
}
}
if (event->mask & IN_MOVED_FROM) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was moved from.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was moved from.\n", event->name, event->cookie);
}
}
if (event->mask & IN_MOVED_TO) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was moved to.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was moved to.\n", event->name, event->cookie);
}
}
if (event->mask & IN_MOVE_SELF) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %ds was itself moved.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was itself moved.\n", event->name, event->cookie);
}
}
if (event->mask & IN_DELETE_SELF) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was itself deleted.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was itself deleted.\n", event->name, event->cookie);
}
}
if (event->mask & IN_ATTRIB) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d attr was changed.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d attr was changed.\n", event->name, event->cookie);
}
}
if (event->mask & IN_ACCESS) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was accessed.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was accessed.\n", event->name, event->cookie);
}
}
i += sizeof(struct inotify_event) +event->len;
}
}
(void) inotify_rm_watch(fd, wd);
(void) close(fd);
exit(0);
}
Tiskni
Sdílej: