Skip to content

文卓的笔记

业精于勤,荒于嬉;行成于思,毁于随。

  • 主页

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Recent Comments

  • wenzhuo on Configuring IPsec IKEv1 with PSK and Xauth in openwrt 15.05
  • wenzhuo on Configuring IPsec IKEv1 with PSK and Xauth in openwrt 15.05
  • AS on Configuring IPsec IKEv1 with PSK and Xauth in openwrt 15.05
  • ACV0RU on Configuring IPsec IKEv1 with PSK and Xauth in openwrt 15.05
  • wenzhuo on Configuring IPsec IKEv1 with PSK and Xauth in openwrt 15.05

Recent Posts

  • Setting up a chan_sip trunk for CTCIMS in FreePBX
  • Preferring Chinese fonts to Japanese ones in Ubuntu 18.04
  • Upgrading an OpenWrt 18.06.1 x86_64 ext4 image to 18.06.2
  • Building libdvdcss DLL for Windows using MinGW
  • Deploying certificates to Prosody automatically upon Certbot renewal

Archives

  • May 2020
  • June 2019
  • February 2019
  • October 2018
  • May 2018
  • April 2018
  • October 2016
  • September 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015

Month: December 2015

Perl One Liners

  • 将字符串进行URL编码(Percent-encoding, aka URL encoding)

  • $ ls *.mp4 | perl -MURI::Escape -lpe '$_ = uri_escape($_)'
    

    或者

    $ ls *.mp4 | perl -lpe 's/([^\w\-~.])/sprintf("%%%02X", ord($1))/seg'
    
Posted on 2015-12-062015-12-07Leave a comment on Perl One Liners
Proudly powered by WordPress