Skip to content

Instantly share code, notes, and snippets.

View szabgab's full-sized avatar

Gábor Szabó szabgab

View GitHub Profile
@szabgab
szabgab / gist:df28064eb595bd91a961d46d6540db67
Last active October 1, 2025 11:23
Ubuntu 25.04 as host and Windows 10 as guest on VirtualBox
I run Ubuntu 25.04. On it I gave Oracle VirtualBox 7.2.0.
I have a Windows 10 installation that used to work. (I think last time I tried it was when I was still using Ubuntu 24.10 and it was an older version of VirtualBox. (I think it was 7.0)
Now when I try to start the Windows guest I get a popup error message about a critical error and I get the following log.
I also tried to create a new Virtual machine and install Windows in that, but when I try to start that machine I get the same error popup.
Any idea how can I convince VirtualBox to work again?
@szabgab
szabgab / download.rs
Last active September 17, 2025 07:05
use std::fs::File;
use std::io::{BufRead, BufReader};
use reqwest::Error;
fn get_urls_file() -> String {
let args = std::env::args().collect::<Vec<String>>();
if args.len() < 2 {
eprintln!("Usage: {} <urls_file>", args[0]);
std::process::exit(1);
@szabgab
szabgab / multitail.rs
Last active September 16, 2025 12:35
use std::env;
use std::path::PathBuf;
use tokio::fs::File;
use tokio::io::{AsyncBufReadExt, AsyncSeekExt, BufReader, SeekFrom};
use tokio::time::{Duration, sleep};
async fn tail_file(path: PathBuf) {
println!("Tailing file: {}", path.display());
let mut file = match File::open(&path).await {
Ok(f) => f,
@szabgab
szabgab / tail.rs
Last active September 28, 2025 22:57
tail -f in rust
use std::{env, path::PathBuf, time::Duration};
use tokio::fs::File;
use tokio::io::{AsyncBufReadExt, AsyncSeekExt, BufReader, SeekFrom};
use tokio::time::sleep;
#[tokio::main]
async fn main() {
let filename = get_filename();
tail_file(filename).await;
}
@szabgab
szabgab / walk.rs
Last active September 4, 2023 17:55
use std::path::Path;
use std::fs::ReadDir;
//#[derive(Debug)]
//#[allow(dead_code)]
struct Walk {
rds: Vec<ReadDir>,
}
use strict;
use warnings;
use feature 'say';
use Time::HiRes qw(sleep time stat);
{
open(my $fh, '>', 'first.txt');
close $fh;
}
# this is planned to be a bit more generic than needed here
my $root = $*PROGRAM.absolute.IO.dirname;
if $root.IO.basename eq 'bin' {
$root = $root.IO.dirname;
}
my $files = Bailador::Route::StaticFile.new: directory => $root, path => /.*/;
get '/(.*)' => sub ($url) {
#return $root;
my $file = ($url eq '' ?? 'index' !! $url) ~ '.html';
names = ["Foo", "Borg", "Earth"]
print(sorted(names))
print(sorted(names,key=len))
print(sorted(names, key=lambda x: x[1] ))
a = [
["Joe", 23],
["Mary", 78],
["Steffan", 100],
]
air:Perl6-Maven gabor$ ack ~~
app.pl
70: if $file ~~ /\/$/ {
95: if $file ~~ /tutorial\/(.*)/ {
lib/Perl6/Maven/Page.pm6
29: if $line ~~ m/^\=(\w+) \s+ (.*)/ {
84: if $row ~~ /^\<code (\s+ lang\=\".*\")? \>\s*$/ {
87: } elsif $row ~~ /\<\/code\>/ {
91: $row ~~ s:g/\</&lt;/;
@szabgab
szabgab / gist:7a08dd2d108177618ac0
Created October 22, 2014 15:04
MetaCPAN API error
use strict;
use warnings;
use Data::Dumper qw(Dumper);
use HTTP::Tiny;
use JSON qw(to_json);
my $ua = HTTP::Tiny->new();
my $query_json = to_json {
query => {
match_all => {},