Xu Xiaodong avatar Xu Xiaodong committed e97f2a1

add get_pkgs and install_packages

Comments (0)

Files changed (4)

+#!/usr/bin/env perl
+#
+# name:      get_pkgs
+# author:    Xu Xiaodong <xxdlhy@gmail.com>
+# license:   GPL
+# created:   2011 Aug 15
+# modified:  2011 Aug 15
+#
+
+use strict;
+use warnings;
+
+use feature qw(say);
+
+my @pkgs;
+
+open my $in_fh, '<', "$ENV{HOME}/misc/alog"
+  or die "Can't open file: $!\n";
+
+while (<$in_fh>) {
+  push @pkgs, $1 if /\[INSTALL\] (.*)$/;
+}
+
+close $in_fh;
+
+say for sort @pkgs;
+
+# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=perl
+#!/usr/bin/env perl
+#
+# name:      install_packages, install packages in ubuntu
+# author:    Xu Xiaodong <xxdlhy@gmail.com>
+# license:   GPL
+# created:   2011 Aug 15
+# modified:  2011 Aug 15
+#
+
+use strict;
+use warnings;
+
+my @pkgs = qw(
+  fcitx
+  fcitx-table-wubi
+  flashplugin-installer
+  git
+  libautodie-perl
+  libdate-calc-perl
+  libmodern-perl-perl
+  mercurial
+  ncurses-term
+  p7zip
+  p7zip-rar
+  perl-doc
+  perltidy
+  ruby1.9.1
+  rxvt-unicode
+  squashfs-tools
+  suckless-tools
+  thunderbird
+  tmux
+  tree
+  ttf-droid
+  vim
+  zathura
+  zsh
+);
+
+for my $pkg (@pkgs) {
+  print "Installing $pkg ...\n";
+  system 'sudo', 'aptitude', '-y', 'install', $pkg;
+}
+
+# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=perl
 # author:    Xu Xiaodong <xxdlhy@gmail.com>
 # license:   GPL
 # created:   2011 Apr 27
-# modified:  2011 Apr 27
+# modified:  2011 Aug 15
 #
 
 require 'find'
 require 'fileutils'
 
 home = Dir.home
-path = home + '/work'
+path = home + '/works'
 
 Find.find(path) do |f|
   if File.file?(f) and File.executable?(f)
 #!/usr/bin/env perl
 #
-# name:      uptime.pl
+# name:      uptime
 # author:    Xu Xiaodong <xxdlhy@gmail.com>
 # license:   GPL
 # created:   2011 Apr  9
-# modified:  2011 Apr 28
+# modified:  2011 Aug 15
 #
 
-use Modern::Perl;
-use Date::Calc qw/Time_to_Date/;
+use strict;
+use warnings;
+
+use feature qw(say);
+
+use Date::Calc qw(Time_to_Date);
 use autodie;
 
 open my ($in_fh), '<', '/proc/uptime';
 my ( $hour, $min, $sec ) = ( Time_to_Date($time) )[ 3 .. 5 ];
 
 if ( $hour > 0 ) {
-    say "${hour}h ${min}m ${sec}s";
+  say "${hour}h ${min}m ${sec}s";
 }
 else {
-    say "${min}m ${sec}s";
+  say "${min}m ${sec}s";
 }
+
+# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=perl
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.