
Есть старый мем: а что, если сделать троллейбус из буханки хлеба? Можно, но зачем. В исходнике того самого Тетриса, который Алексей Пажитнов написал для Электроники-60 в ВЦ Академии наук, есть процедура ровно такого устройства. Игра тратит 958 байт кода на то, чтобы при каждом запуске заново вычислить 342 байта данных: семь фигур, их девятнадцать положений и правила поворота. Готовую таблицу можно было положить в программу и не вычислять ничего.
Код игры восстановлен: он компилируется байт в байт в тот же файл, что снят с ленты. Все 590 строк можно открыть и читать.
Фигура в Тетрисе это тетромино: четыре клетки, склеенные сторонами. Разных тетромино семь, и называть их принято латинскими буквами, похожими по очертанию: I, O, T, S, Z, J, L. Давайте посмотрим, как игра строит эти семь фигур и их производные положения. Под катом шесть коротких анимаций и немного старого Паскаля
Читать далее
Добавляете нового пира на сервер WireGuard — и у соседнего в wg show вместо префикса появляется allowed ips: (none). Команда отработала успешно, dmesg пуст, wg-quick промолчал, туннель up, handshake свежий. А если бы у нового пира маска была /32 вместо /24, ничего бы не произошло.
Это ловят снова и снова: в трекере VyOS с 2020-го (закрыто как Invalid — «так делает ядро»), в OPNsense в 2025-м, на форуме OpenWrt каждый раз, когда к серверу добавляют второй телефон.
Разбор по drivers/net/wireguard/ мейнлайна, тег v6.12: почему AllowedIPs вообще не хранится у пира, что делает list_move_tail в allowedips.c:201, почему симптом «пропало у одних пиров, но не у всех» объясняется одной строкой parent->cidr == cidr, и откуда берётся ping: sendmsg: Required key not available, если вы его когда-нибудь видели и решили, что это про ключи шифрования.
И заодно: то же самое лежит в FreeBSD, OpenBSD, BoringTun, wireguard-go и в драйвере под Windows — шесть кодовых баз, пять разных структур данных, один и тот же молчаливый контракт. А MikroTik, который запрет прямо задокументировал, сам его не проверяет: на CHR оба пира показывают префикс, трафик идёт одному, и вернуть его второму можно только записью того же самого значения обратно.
Плюс способ проверить самому: настоящий allowedips.c из ядра, собранный в userspace одним gcc. Без модуля и без root.
Mykhailo Fedorov says Ukraine is innovating its arsenal of weapons quickly; Moscow hit with ‘one of the most massive drone attacks’. What we know on day 1,637
Ukraine could be capable of striking Russia with domestically made ballistic missiles in three to six months, the former Ukrainian defence minister Mykhailo Fedorov has estimated. Kyiv has so far relied mostly on long-range drones and cruise missiles for deep strikes against Russia, but attacks with ballistic missiles will be far harder for Russian forces to thwart. In an interview with CBS News, Fedorov said: “We need to defeat Russia in every technological cycle.” Though Ukraine is innovating quickly, Fedorov warned that Russia is also advancing rapidly. Fire Point, a Ukrainian defence manufacturer, is developing ballistic missiles and conducted a launch test in June. Fedorov was one of the key drivers of Ukraine’s highly effective drone programme but was controversially fired in July.
Ukraine on Sunday launched one of its largest drone attacks since the start of the war, causing a fire at a Wildberries distribution warehouse near Moscow and killing at least six people, according to Russian authorities. The defence ministry in Moscow said it had shot down 1,478 Ukrainian drones in the past 24 hours – the highest ever total claimed, Dan Sabbagh reports. Moscow’s regional governor Andrey Vorobyov described the overnight assault as “one of the most massive drone attacks in recent memory”.
In the attack, Ukraine hit a missile fuel production facility in Russia’s Rostov region, the Ukrainian military said on Sunday. It said the company “manufactures solid rocket propellant for multiple launch rocket systems, as well as for a range of missile systems and airborne weapons”.
A Spanish fighter jet on Sunday shot down a drone that had breached Romanian airspace near the border with Ukraine and Moldova, Nato said. The interception of the drone – which entered from Moldova – was carried out by an F-18, deployed on Nato duties, the Romanian defence ministry said. Debris fell in an unpopulated area of the Galati region, near the Ukrainian border. A growing number of drones have crossed into Nato states in eastern Europe as Russia pursues its invasion of Ukraine.
The EU foreign policy chief, Kaja Kallas, has said she wants to increase by one-third the number of Russian entities sanctioned over the Ukraine war, German newspaper Die Welt reported on Monday. The bloc has adopted 21 rounds of sanctions against Russia since 2022. “For autumn I am putting forward the most far-reaching sanctions listings since the start of the war,” Kallas told the paper. “Once adopted, they would immediately raise the total number of sanctioned Russian entities by a third.” In July, the EU adopted a watered down sanctions package only approved after protracted negotiations among member states, after some objected to tougher measures.
In Ukraine, a barrage of Russian drones and missiles on Sunday killed two people and wounded 14 at ArcelorMittal’s steel plant in Kryvyi Rih, the home town of the Ukrainian president, Volodymyr Zelenskyy. The plant, one of Ukraine’s biggest steel producers, said it had partially halted operations because of the strike. Another attack hit Kryvyi Rih on Sunday evening, killing one person. Strikes also killed two people in the Zaporizhzhia region. In Kyiv, a popular outdoor book market at Pochaina, long the place to find rare and antiquarian volumes, was hit by the Russian attack. Bookseller Dmytro Semenukha saw all four of his stalls burn to the ground. “There used to be a store. And books, and flags of all the countries, all the countries. Tons of everything. And that’s it,” the 45-year-old told Agence France-Presse.
In a social media post on the overnight raid, Zelenskyy said that “wherever the Russians can reach with their ballistic missiles, they strike civilian infrastructure”. Over the past week, Zelenskyy said, Ukrainian cities had been pummelled by “more than 1,550 attack drones, nearly 1,560 guided aerial bombs, and 62 missiles”, as he renewed his appeal to allies for more air defence.
Russian officials said on Monday that an overnight Ukrainian missile strike had killed six people and wounded another four, including a 14-year-old child, in the Belgorod region.
Continue reading...President says he ‘gets along great’ with dictator but US officials say Ukraine war is boosting North’s capabilities
Donald Trump has said he is scaling back joint US military drills with South Korea aimed at deterring North Korea, despite military officials from both countries warning that Kim Jong-un’s regime is learning new battlefield tactics from the Ukraine war.
The drills under Ulchi Freedom Shield, one of two major annual exercises held by South Korea and the US, start on Monday and run until 27 August.
Continue reading...Mir Hussain has been followed by TV cameras since he was a child, and managed to deliver love and laughter alongside his struggle. Now his previous Bafta-winning documentary gets an update
Mir Hussain remembers the first time he saw a video camera: “I looked at it and it looked straight back at me.” His relationship with this all-seeing eye has broadened and deepened in the years that followed. Since 2002, when Phil Grabsky and Shoaib Sharifi first started documenting his story, Mir has lived an extraordinary life: grinding poverty and impossibly hard work, eking out a living in the mountainous Bamiyan province and then in urban Afghanistan, but combined with a remarkable level of exposure to the world, via modern media.
Mir and his family first appeared on our screens in 2021, in the Bafta-winning film My Childhood, My Country – 20 Years in Afghanistan. This updated reversioning of that film contains plenty of the same footage but also, in a telling update, hits very differently in the light of what happened that year. In April 2021, US president Joe Biden announced the withdrawal of American soldiers from Afghanistan. Essentially, the US (and their allies, including Britain) abandoned the country to the Taliban extremists. The knowledge of this incipient horror looms unavoidably large; the whole film now feels like foreshadowing.
Continue reading...China has established the first scheduled transit through the northern sea route, but questions remain over the environmental and political risks
When Marco Rubio suggested that the world should look to new shipping lanes to bypass the logjammed strait of Hormuz, it’s unlikely he had the Arctic’s northern sea route in mind.
And yet in recent months the promise of this 5,500km channel – cleaved through frozen seas by nuclear-powered icebreakers and illuminated by a sun that never dips below the Arctic horizon – has grown.
Continue reading...At least 2,325 people have died from the virus, according to official data, with outbreak on track to be biggest in history
The Ebola outbreak in the Democratic Republic of the Congo is now the deadliest in the country’s history, with at least 2,325 people dead, according to government data, surpassing the toll from the 2018-20 outbreak.
The DRC’s public health institute said confirmed cases had risen to 4,945, including 101 detected in the previous 24 hours.
Continue reading...President says he ‘gets along great’ with dictator but officials say Ukraine war is boosting North’s capabilities
Donald Trump has said he is scaling back joint US military drills with South Korea aimed at deterring North Korea, despite military officials from both countries warning that Kim Jong-un’s regime is learning new battlefield tactics from the Ukraine war.
The drills under Ulchi Freedom Shield, one of two main annual exercises held by South Korea and the US, start on Monday and run until 27 August.
Continue reading...At least 2,325 people have died from the virus, according to official data, with outbreak on track to be biggest in history
The Ebola outbreak in the Democratic Republic of the Congo is now the deadliest in the country’s history, with at least 2,325 people dead, according to government data, surpassing the toll from the 2018-20 outbreak.
The DRC’s public health institute said confirmed cases had risen to 4,945, including 101 detected in the previous 24 hours.
Continue reading...