今日已更新 328 条资讯 | 累计 20300 条内容
关于我们

标签:#go

找到 559 篇相关文章

AI 资讯

Real-time IP capacity in Google Cloud subnets

When managing Shared VPCs, most teams allocate dedicated IP subnets for each service project to keep firewall rules simple, but this isolation often leads to poor IP utilization — it is not uncommon to see subnet IP utilization hovering in the low teens. On the other hand, using large shared subnets requires coordinating workload deployments to ensure there is enough internal IP address space for everyone. To optimize these shared networks, you need real-time visibility. The WITH_UTILIZATION query parameter on the Method: subnetworks.list | Compute Engine API solves this by returning the exact count of allocated and free IP addresses for each subnet IP range. This capability is designed for query-time decisions. For example, if you need to deploy a GCE workload requiring 100 instances, you can search for a subnet with enough capacity. This query-time data comes directly from Google Cloud's internal IP allocator and includes both primary and secondary CIDR ranges. Automating the search with gcloud and jq To automate capacity checks before you deploy, you can script this check. The script below uses gcloud compute networks subnets list | Google Cloud SDK to grab the utilization data as JSON, and then uses jq to parse, filter, and sort the subnets based on your required capacity: #!/bin/bash # --- Configuration (Replace with your details) --- PROJECT = "<YOUR_PROJECT_ID>" NETWORK_NAME = "<YOUR_VPC_NETWORK_NAME>" REGION = "<YOUR_REGION>" REQUIRED_IP_CAPACITY = 100 echo "Searching $NETWORK_NAME in $REGION for subnets with >= $REQUIRED_IP_CAPACITY free IPs..." echo "------------------------------------------------------------------------" # Fetch subnets with utilization data, output as JSON, and pipe to jq gcloud compute networks subnets list \ --project = " $PROJECT " \ --network = " $NETWORK_NAME " \ --regions = " $REGION " \ --view = WITH_UTILIZATION \ --format = json | \ jq -r --argjson min_ips " $REQUIRED_IP_CAPACITY " ' [ .[] | { name: .name, cidr: .ipCidrRange, #

2026-06-17 原文 →
开发者

Google’s first smart speaker in six years arrives next week

Google's first new smart speaker in six years starts shipping on June 29th, narrowly missing its promised spring launch window. Preorders for the Google Home Speaker open today, June 17th. Nothing has changed hardware-wise in the nine months since the $99 speaker was announced. It has the same slightly squished round design, with touch-capacitive buttons […]

2026-06-17 原文 →
AI 资讯

What on Earth is "Agentic Browsing"?

I Built a Vanilla JS Web App that Scored 100/100 Under Lighthouse’s New "Agentic Browsing" Audit. Here’s What It Means. If you have run a performance audit on PageSpeed Insights or Lighthouse recently, you might have noticed a fascinating new line item quietly slipping into the metadata report: Agentic Browsing . When I audited my free tool suite, Paktheta , I managed to hit the ultimate developer milestone— a perfect 100/100 across Performance, Accessibility, Best Practices, and SEO. But seeing that perfect score alongside the label "Agentic Browsing" got me thinking. What exactly is an AI-driven agent experiencing when it hits our sites, and why is this the new gold standard for web performance? Let's dive into what Agentic Browsing actually means for the future of optimization. What on Earth is "Agentic Browsing"? Historically, speed tests like Lighthouse were passive. A headless browser opened your URL, waited for the page to load, recorded metrics like First Contentful Paint (FCP) and Largest Contentful Paint (LCP), and closed the tab. It was a linear, predictable, and frankly synthetic snapshot. Agentic Browsing changes the paradigm entirely. Instead of a basic static script, modern auditing platforms use autonomous, intelligent browser agents. Guided by modern AI-driven browser control (using updated instances like HeadlessChromium), these agents don't just stare at your page—they explore it like a real human would. An agentic audit runner will: Identify interactive buttons and click them to test responsiveness. Scan form elements to see if they accept paste commands cleanly. Intelligently look for broken layout shifts (CLS) by dynamically scrolling and triggering micro-animations. Interact with JavaScript components to see if they block the main execution thread. In short: It simulates real, unpredictable human behavior at lightning speed. If your site relies on bloated frameworks that look fast initially but lock up the second a user tries to interact, an a

2026-06-17 原文 →
AI 资讯

AI Use by the US Government

On 14 April, the Trump administration quietly acknowledged the widespread use of AI to automate government processes. The office of management and budget (OMB) disclosed a staggering 3,611 active or planned use cases for AI across the federal government. The list has ballooned by 70% from the one published in the final year of the Biden administration, and includes many disturbing-seeming plans to hand over sensitive governmental functions to AI. Scanning this list, many readers may find many causes for alarm. It represents a transfer of decision processes from human to machine on a massive scale over matters of individual freedom, public health and well-being, nuclear reactor safety and more...

2026-06-17 原文 →
AI 资讯

Production RBAC patterns for Go and Node startups

A founder told me last year: "We need admin features shipped by Friday. Can we just hardcode the roles for now?" That was 7 months ago. They're still paying for that decision today. This article is the breakdown I wish I had given them before that Friday — the patterns that separate a quick MVP version of RBAC from one that won't bite you back in six months. If you're a startup CTO, technical founder, or senior engineer about to ship admin/dashboard features for the first time, this is for you. The 4 signs your RBAC is a time bomb I've reviewed this exact pattern in 5+ early-stage codebases. Every one of them eventually hit the wall. Look for these signs: 1. Roles hardcoded in the JWT { "sub" : "user_123" , "role" : "admin" } Simple. Until you need to: Add a new role → migration + token refresh strategy Give one user a temporary elevated permission → "we'll just reissue tokens" Audit who had admin last month → good luck 2. Permission checks scattered across 40+ controllers // In every single handler: if user . Role != "admin" { return c . Status ( 403 ) . JSON ( ... ) } By the time you have 30 endpoints, you've made the same mistake 30 times. Refactoring is a full sprint. 3. One admin superuser that can do everything Until a sales rep accidentally deletes a customer record because they were elevated to admin "just for that one task last week." 4. Zero audit trail When the data goes missing, your only investigative tool is git blame on the source code and a desperate grep through CloudWatch logs. If you've nodded at any of these — keep reading. The real problem: policies-as-code Most teams treat permissions like business logic. They live in source files, gated by if statements, deployed with the rest of the code. This is the original sin. Code changes need deploys. Permissions change daily. When marketing onboards a new role next quarter, when a customer success rep needs view-only access to billing, when legal asks "who could have read this customer's data on Tuesda

2026-06-17 原文 →
开发者

What I Learned Building My First Go Project (go-reloaded)

During my first week at Zone01 Kisumu, I worked on a project called go-reloaded . It was my first real hands-on experience using Go, and it helped me understand not just the language, but also how to think like a developer. In this article, I’ll share what I learned, the challenges I faced, and the key concepts that made everything click. What the Project Was About The goal of the project was to build a small Go program that works with command-line arguments and processes input using Go’s standard libraries. This was my first time interacting deeply with: os package command-line arguments (os.Args) basic Go program structure At first, it felt confusing, but step by step, things started to make sense. What I Learned How command-line arguments work in Go I learned that Go provides access to raw input from the terminal using: os.Args This returns a slice of strings where: os.Args[0] is the program name os.Args[1:] are the actual inputs Working with the os package The os package became one of the most important parts of the project. I used it to: Read input arguments Handle program execution flow Understand how programs interact with the system This helped me realize that Go is very close to the system level compared to JavaScript. Breaking problems into smaller steps One of the biggest lessons wasn’t about code—it was about thinking. Instead of trying to solve everything at once, I learned to: Understand the problem first Break it into smaller tasks Solve each part step by step This made debugging much easier. Challenges I Faced At the beginning, I struggled with: Understanding how os.Args works Knowing where to start in the code Handling errors when inputs were missing Sometimes I would get stuck just trying to figure out what the program was actually receiving. But debugging helped me a lot. Printing values at each step made things clearer. Key Takeaways Go is very explicit compared to JavaScript The os package is powerful for system-level interaction Command-line ar

2026-06-17 原文 →
AI 资讯

I Stopped Paying Google and Built My Own Cloud

How I replaced Google Photos, Google Drive, and Google Home with a self-hosted Raspberry Pi 5 setup - and what the full technical stack looks like. There's a quiet moment every tech-literate person eventually hits. You open your cloud storage dashboard, see the number creeping up, and think: I'm paying a subscription fee, every month, forever, just to store my own photos and files on someone else's computer. That was me, but with a bit of added weight. It's not just my data I'm responsible for. Over the years, I've quietly become the unofficial digital curator for my entire family . The person everyone sends photos to after a birthday party. The one who backs up the wedding videos. The one who scans and stores the important documents, passports, contracts, and sentimental things so they don't get lost. My parents, siblings, extended family: if something matters and it's digital, there's a good chance it eventually lands with me. That's a responsibility I take seriously. And for a long time, Google was my answer - until the storage bill started quietly creeping past 2TB, and I started thinking more carefully about what it actually means to hand all of that data over to "big tech" . So I built my own home server. A tiny, almost silent box sitting in my house that now handles everything Google Drive and Google Photos did, plus more, for a one-time hardware cost of £340. This is the story of how I did it, why I did it, and exactly how you can too. Why I Did It The cost was the trigger, but it wasn't the only reason. When you use Google Photos, Google Drive, or any cloud storage service, your files live on their servers. You're trusting a corporation to keep them safe, not snoop through them, not change their pricing, and not shut down the product one day. Google has a long history of killing beloved products. Google Photos itself famously ended its unlimited free tier in 2021. As well as this, recent AI trends and auto opt-in data processing had me thinking there had to

2026-06-17 原文 →
AI 资讯

Giving your agents a terminal: a first look at the tabstack CLI

Every project I touch lately ends up needing the same awkward thing: a reliable way to pull the web into a script or an agent. Not a brittle scrape held together with CSS selectors and hope, but something that takes a URL and hands back clean, structured text I can actually pipe into the next step. I have built that wrapper more than once, and it is never as small as you think it will be. So when Mozilla dropped the tabstack CLI, a single Go binary that wraps the Tabstack AI API, I wanted to spend a proper afternoon with it. The pitch on the README is direct: every web interaction your agent or stack needs, from the terminal or a script. It turns any URL into clean Markdown or schema-shaped JSON, runs natural-language browser automation, and answers research questions with cited sources. The part that made me sit up is that the output is pretty in a terminal and pipeable into jq without a flag. That is a small detail, and it tells you the people who built it actually live on the command line. Let me walk you through it the way I poked at it myself. Getting it installed There is no runtime to install and nothing to bootstrap, because it ships as a single static binary built for macOS, Linux, and Windows. The quickest route is the install script: curl -fsSL https://tabstack.ai/install.sh | sh That fetches the right binary for your platform and puts it on your PATH , and you are ready to go. If you would rather not pipe a script into your shell, there are a couple of alternatives. With Go on your machine you can use: go install github.com/Mozilla-Ocho/tabstack-cli/cmd/tabstack@latest That drops the binary in $GOPATH/bin , which is usually ~/go/bin . If your shell cannot find tabstack afterwards, you almost certainly have not got that directory on your PATH : export PATH = " $HOME /go/bin: $PATH " And if you want to avoid Go entirely, there are pre-built binaries on the Releases page, or you can clone the repo and run make install-local , which builds it and copies it t

2026-06-17 原文 →
开发者

All the latest news on Android 17, Wear OS 7, and Android XR

Google’s Android 17 update includes highlights like new floating “Bubble” app windows for easier multitasking, a Screen Reaction recording mode, and a 50/50 split gaming mode for foldable phones. Meanwhile, Wear OS 7 brings Live Updates, better battery life for smart watches, and prepares connections for new Android XR smart glasses that will launch this […]

2026-06-17 原文 →
AI 资讯

Android 17 arrives on Pixel phones today

Following its official debut last month, Google is now rolling out Android 17 to compatible Pixel phones, alongside additional exclusive features as part of the June Pixel Drop. Not every feature announced alongside the OS at the pre-I/O Android Show is available today though. Android 17 itself is arriving on Pixel phones today, and Google […]

2026-06-17 原文 →
AI 资讯

The Google / Xreal Aura XR glasses are now available to preorder

The Project Aura glasses collaboration between Xreal and Google is now one step closer to being something you can buy. Reservations for the second Android XR device, now dubbed the Xreal Aura, are available for $99 starting today, with a full launch in the US, UK, Japan, Canada, and South Korea expected sometime this Fall. […]

2026-06-17 原文 →
开发者

YouTube字幕突然消失?原来是节点的锅——一次极其小众的排障经历

问题降临:毫无征兆 那天和往常一样,打开YouTube准备看一个英文视频。习惯性地点开字幕按钮—— 没反应。 不是字幕延迟,不是字幕错位,而是整个字幕功能像是从这个世界上蒸发了一样。原始语言的字幕不可用,点进字幕设置一看,连翻译选项都是灰的。没有原始字幕,自然也就没有任何语言的翻译字幕。 一整个功能链,从根部断裂。 第一反应:一定是扩展插件搞的鬼 作为一个浏览器里装了不少扩展和油猴脚本的用户,我的第一直觉非常明确—— 肯定是哪个插件冲突了。 这个判断合情合理。浏览器扩展劫持页面元素、油猴脚本注入自定义代码,这些操作干扰YouTube的正常功能,实在是太常见了。之前遇到过播放器界面异常、按钮消失之类的问题,十次有八次都是扩展惹的祸。 于是我开始了标准排障流程: 禁用所有油猴脚本 → 刷新 → 字幕依然不可用 禁用所有浏览器扩展 → 刷新 → 字幕依然不可用 开无痕模式 (彻底排除扩展和缓存影响)→ 字幕依然不可用 三轮操作下来,扩展插件的嫌疑被彻底洗清。 但这还不是最让人困惑的部分。 真正的诡异之处:薛定谔的字幕 在反复测试的过程中,我发现了一个极其反直觉的现象: 字幕的可用性是随机的。 开着所有扩展 → 有时候字幕 有 ,有时候 没有 关掉所有扩展 → 有时候字幕 有 ,有时候 没有 这完全打破了因果逻辑。如果问题出在扩展上,那么"关掉扩展"就应该稳定地解决问题。但现实是,开和关都呈现随机状态,说明扩展根本不是变量—— 真正的变量藏在别的地方。 这种"薛定谔的字幕"状态让我一度非常迷茫。你没办法用常规的控制变量法去定位一个表现为随机的问题,除非你能找到那个真正在变化的隐藏变量。 灵光一闪:换个节点试试? 在排除了浏览器层面的所有可能之后,我突然想到了一个平时根本不会和"字幕"联系在一起的东西—— 网络节点。 抱着试一试的心态,我切换了代理节点,选了一个不同地区的服务器。 刷新页面。 字幕回来了。 原始字幕、自动翻译、多语言选项——一切恢复正常,仿佛之前的问题从未发生过。 我又切回原来的节点——字幕消失了。再切到新节点——字幕回来了。反复测试了好几次,结果完全一致。 真相大白:问题出在节点上。 恍然大悟:视频和字幕,原来是两套系统 这次经历让我意识到一个之前从未注意到的事实: YouTube的视频流和字幕数据,很可能是由不同的服务器(或CDN节点)分别提供的。 这意味着: 视频能正常播放 ≠ 字幕能正常加载 你的网络可以顺畅地连接到视频服务器,但与此同时,字幕服务器可能对你当前的IP/地区/节点不可达或响应异常 不同的代理节点连接到的Google后端服务器不同,某些节点恰好无法正常获取字幕数据 这也完美解释了之前"随机可用"的现象。我在测试扩展的过程中,代理工具可能在后台自动切换了节点(很多代理工具有负载均衡或自动切换功能),导致有时碰巧连上了能提供字幕的服务器,有时则没有。我一直以为变量是"扩展的开关",实际上真正在暗中变化的是"网络节点"。 技术推测 虽然Google没有公开YouTube的完整架构细节,但根据这次经历可以合理推测: YouTube使用分布式CDN架构 ,视频内容、字幕数据、评论、推荐信息等可能分布在不同的微服务和服务器集群上 字幕API的端点 可能与视频流的端点不同,它们的可用性、地理限制、负载状况都是独立的 某些地区的某些IP段可能因为各种原因(服务器维护、区域限制、DNS解析差异、临时故障)无法正常访问字幕服务 这种问题具有 高度的偶发性和地域性 ,这也是为什么它如此小众,在网上几乎搜不到相关讨论 写在最后 这大概是我遇到过的最小众、最反直觉的技术问题之一。 它小众到什么程度呢?你去搜索"YouTube字幕不可用",得到的答案几乎都是:清除缓存、禁用扩展、检查字幕是否被上传者关闭、换个浏览器试试。 没有人会告诉你"换个代理节点"。 因为在绝大多数人的认知里,"视频都能看"就等于"网络没问题",不会有人把字幕缺失和网络节点联系在一起。 但事实就是这么奇怪: 视频能播放,不代表字幕能加载,因为它们根本就不在同一条路上。 这次经历也给了我一个教训:当排障陷入死胡同的时候,不要只盯着最明显的嫌疑犯。真正的问题,有时候藏在你认为"完全不可能"的地方。 下次再遇到YouTube的某个功能莫名其妙消失,而视频本身却能正常播放的时候——先换个节点试试。说不定,答案就在那里。

2026-06-16 原文 →