This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* compile with cc -o interfaces interfaces.c */ | |
#include <ifaddrs.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <net/if.h> | |
int main() { | |
struct ifaddrs *ifap; | |
if( getifaddrs(&ifap) < 0 ) { | |
perror("getifaddrs returned an error:"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl -w | |
use v5.16; | |
use strict; | |
use warnings; | |
while(<>) { | |
chomp; | |
my ( $username, $password, $uid, $gid, $class, $change, $expire, $gecos, $home, $shell ) = split ':' // die "cannot parse $_"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Gtk3 -init; | |
my $hello = Gtk3::MessageDialog->new (undef, 'modal', 'info', 'ok', "Hello world!"); | |
$hello->set ('secondary-text' => 'This is an example dialog.'); | |
$hello->run; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use v5.14; | |
use strict; | |
use warnings; | |
use JSON::XS; | |
use File::Slurp; | |
use Data::Dump; | |
use Data::Printer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use warnings; | |
use YAML; | |
use Data::Dumper; | |
my $slurp = do { local $/ ; <> }; | |
my $data = Load( $slurp ) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use warnings; | |
use Carp; | |
use MIME::Base64; | |
use Compress::Zlib; | |
use URI; | |
use URI::QueryParam; | |
use XML::Canonical; |