Compartilhe com fpaste.org

Olá,

Todos nós já passamos por aquele problema “cabeludo” e complicado de ser resolvido, não?! Para alguns a solução é dar uma volta e/ou cevar um novo chimarrão com alecrim para clarear as ideias :) E se mesmo assim o problema persistir, o esquema é então trocar uma ideia com um amigo para tentar clarear o problema.

Sim! Todos nós já passamos por tal situação. OK, talvez nem todos tenham cevado um chimarrão, mas o que importa é que na maioria das vezes precisamos compartilhar um log, arquivo de configuração, trecho de código, etc e colar essas mensagens via MSN/gtalk/ICQ/Jabber/IRC o que é um tanto quanto incoveniente sem contar que a formatação pode ser alterada, dificultando a leitura.

Uma maneira rápida de compartilhar logs/códigos sem precisar realizar todo o procedimento de abrir o browser, copiar e colar a mensagem utilizando sites como o PasteBin.com por exemplo, é utilizar o aplicativo fpaste no Fedora.

A simples ferramenta fpaste consiste em um script em Python(++) que envia o texto para o site fpaste.org retornando a URL recém gerada. Um ponto interessante em minha opinião é que a ferramenta permite a customização, como por exemplo definir a linguagem do trecho de texto compartilhado que irá receber a respectiva syntax highlighting. Por enquanto a permanência máxima para os dados compartilhados é de no máximo 1 dia.

notebook $> rpm -q fpaste
fpaste-0.3.7-1.fc16.noarch

A utilização do script é bem simples.

notebook $> fpaste  --help
Usage: fpaste [OPTION]... [FILE]...
  send text file(s), stdin, or clipboard to the http://fpaste.org/ pastebin and return the URL.

Examples:
  fpaste file1.txt file2.txt
  dmesg | fpaste
  (prog1; prog2; prog3) | fpaste
  fpaste --sysinfo -d "my laptop" --confirm
  fpaste -n codemonkey -d "problem with foo" -l python foo.py

Para facilitar na customização da ferramenta sugiro a criação de um alias de comando definindo algumas preferências:

notebook $> alias fpaste
alias fpaste='fpaste -n mmello -l python -x 3600'

Um funcionalidade que precisa ser destadaca é que podemos compartilhar algumas informações sobre o sistema utilizado. Funcionalidade essa muito interessante em momentos que precisamos de ajuda com aquele driver de som/wifi que não está funcionando.

notebook $> fpaste --sysinfo --confirm
Gathering system info...........................

=== fpaste 0.3.7 System Information (fpaste --sysinfo) ===
* OS Release (lsb_release -ds):
     "Fedora release 16 (Verne)"

* Kernel (uname -r ; cat /proc/cmdline):
     3.1.0-0.rc8.git0.1.fc16.x86_64
     BOOT_IMAGE=/vmlinuz-3.1.0-0.rc8.git0.1.fc16.x86_64 root=/dev/mapper/vg_notebook-lv_root ro rhgb quiet rd.md=0 rd.dm=0 rd.lvm.lv=vg_notebook/lv_swap SYSFONT=latarcyrheb-sun16 rd.luks=0 rd.lvm.lv=vg_notebook/lv_root KEYTABLE=us-acentos LANG=en_US.UTF-8

* Smolt Profile URL:
     N/A

* Desktop(s) Running (ps -eo comm= | egrep '(gnome-session|kdeinit|xfce.?-session|fluxbox|blackbox|hackedbox|ratpoison|enlightenment|icewm-session|od-session|wmaker|wmx|openbox-lxde|openbox-gnome-session|openbox-kde-session|mwm|e16|fvwm|xmonad|sugar-session)' ):
     xfce4-session

* Desktop(s) Installed (ls -m /usr/share/xsessions/ | sed 's/\.desktop//g' ):
     gnome, xfce

* SELinux Status (sestatus):
     SELinux status:                 enabled
     SELinuxfs mount:                /sys/fs/selinux
     Current mode:                   enforcing
     Mode from config file:          enforcing
     Policy version:                 26
     Policy from config file:        targeted

* SELinux Error Count (failed: "selinuxenabled && (grep avc: /var/log/messages; ausearch -m avc -ts today)2>/dev/null|egrep -o "comm=\"[^ ]+"|sort|uniq -c|sort -rn"):
     N/A

* CPU Model (grep 'model name' /proc/cpuinfo | awk -F: '{print $2}' | uniq -c | sed -re 's/^ +//' ):
     2  Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz

* 64-bit Support (grep -q ' lm ' /proc/cpuinfo && echo Yes || echo No):
     Yes

* Hardware Virtualization Support (egrep -q '(vmx|svm)' /proc/cpuinfo && echo Yes || echo No):
     Yes

* Load average (uptime):
      00:00:19 up  2:15,  2 users,  load average: 0.02, 0.03, 0.05

* Memory usage (free -m):
                  total       used       free     shared    buffers     cached
     Mem:          3915       3704        210          0         32       3027
     -/+ buffers/cache:        644       3270
     Swap:         5951         24       5927

* Top 5 CPU hogs (ps axuScnh | awk '$2!=4785' | sort -rnk3 | head -5):
            0     1 18.3  0.6  57952 24696 ?        Ss   Oct08  24:50 systemd
         1000  3761  2.0  2.9 2990424 119472 ?      Sl   Oct08   0:55 rhythmbox
            0  1296  1.8  0.5 133656 20220 tty1     Ss+  Oct08   2:26 Xorg
         1000  1762  1.4  0.1 253864  7596 ?        Sl   Oct08   1:56 xfce4-session
         1000  4079  1.1  0.1 119568  5148 pts/0    Ss   Oct08   0:15 bash

* Top 5 Memory hogs (ps axuScnh | sort -rnk4 | head -5):
         1000  3761  2.0  2.9 2990424 119472 ?      Sl   Oct08   0:55 rhythmbox
         1000  1802  0.0  1.1 1585400 44800 ?       Ssl  Oct08   0:04 dropbox
         1000  2251  0.0  0.7 981264 28576 ?        Sl   Oct08   0:00 e-calendar-fact
            0     1 18.3  0.6  57952 24696 ?        Ss   Oct08  24:50 systemd
         1000  1821  0.0  0.5 557828 23188 ?        Sl   Oct08   0:02 tracker-store

* Disk space usage (df -hT):
     Filesystem                                            Type      Size  Used Avail Use% Mounted on
     rootfs                                                rootfs     34G  6.7G   27G  21% /
     devtmpfs                                              devtmpfs  1.9G     0  1.9G   0% /dev
     tmpfs                                                 tmpfs     2.0G  2.2M  2.0G   1% /dev/shm
     tmpfs                                                 tmpfs     2.0G   47M  1.9G   3% /run
     /dev/mapper/vg_notebook-lv_root                       ext4       34G  6.7G   27G  21% /
     tmpfs                                                 tmpfs     2.0G   47M  1.9G   3% /run
     tmpfs                                                 tmpfs     2.0G     0  2.0G   0% /sys/fs/cgroup
     tmpfs                                                 tmpfs     2.0G     0  2.0G   0% /media
     /dev/sda1                                             ext4      485M   79M  381M  18% /boot
     /dev/mapper/luks-c24525fe-40a9-4839-81fd-da2b11355741 ext4      107G   32G   71G  31% /home

* Block devices (failed: "blkid" AND "/sbin/blkid"):
     N/A

* PCI devices (lspci):
     00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
     00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
     00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
     00:03.0 Communication controller: Intel Corporation Mobile 4 Series Chipset MEI Controller (rev 07)
     00:03.3 Serial controller: Intel Corporation Mobile 4 Series Chipset AMT SOL Redirection (rev 07)
     00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)
     00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
     00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
     00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
     00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
     00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
     00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
     00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
     00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
     00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03)
     00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
     00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
     00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
     00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
     00:1f.0 ISA bridge: Intel Corporation ICH9M-E LPC Interface Controller (rev 03)
     00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03)
     00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
     03:00.0 Network controller: Intel Corporation PRO/Wireless 5100 AGN [Shiloh] Network Connection
     15:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)
     15:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 04)

* USB devices (lsusb):
     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
     Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
     Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
     Bus 001 Device 003: ID 22b8:41d9 Motorola PCS Droid/Milestone

* DRM Information (failed: "grep drm /var/log/dmesg"):
     N/A

* Xorg modules (grep LoadModule /var/log/Xorg.0.log | cut -d \" -f 2 | xargs):
     extmod dbe glx record dri dri2 intel vesa fbdev fbdevhw fb dri2 evdev synaptics

* GL Support (failed: "glxinfo | egrep "OpenGL version|OpenGL renderer""):
     N/A

* Xorg errors (failed: "grep '^\[.*(EE)' /var/log/Xorg.0.log"):
     N/A

* Kernel buffer tail (dmesg | tail):
     [ 8072.808666] NEGADO: IN=eth0 OUT= MAC= SRC=172.16.69.3 DST=255.255.255.255 LEN=149 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=17500 DPT=17500 LEN=129
     [ 8072.813066] NEGADO: IN=eth0 OUT= MAC= SRC=172.16.69.3 DST=172.16.69.255 LEN=149 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=17500 DPT=17500 LEN=129
     [ 8082.054768] NEGADO: IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:84:2b:2b:7c:5c:31:08:00 SRC=172.16.69.2 DST=255.255.255.255 LEN=149 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=17500 DPT=17500 LEN=129
     [ 8082.055204] NEGADO: IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:84:2b:2b:7c:5c:31:08:00 SRC=172.16.69.2 DST=172.16.69.255 LEN=149 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=17500 DPT=17500 LEN=129
     [ 8090.981265] NEGADO: IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:f8:1e:df:f2:08:d2:08:00 SRC=172.16.69.20 DST=255.255.255.255 LEN=147 TOS=0x00 PREC=0x00 TTL=64 ID=35624 PROTO=UDP SPT=17500 DPT=17500 LEN=127
     [ 8090.981970] NEGADO: IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:f8:1e:df:f2:08:d2:08:00 SRC=172.16.69.20 DST=172.16.69.255 LEN=147 TOS=0x00 PREC=0x00 TTL=64 ID=53261 PROTO=UDP SPT=17500 DPT=17500 LEN=127
     [ 8096.243782] NEGADO: IN=eth0 OUT= MAC=01:00:5e:00:00:01:68:7f:74:2b:eb:c0:08:00 SRC=172.16.69.254 DST=224.0.0.1 LEN=28 TOS=0x00 PREC=0x00 TTL=1 ID=0 DF PROTO=2
     [ 8102.846392] NEGADO: IN=eth0 OUT= MAC= SRC=172.16.69.3 DST=255.255.255.255 LEN=149 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=17500 DPT=17500 LEN=129
     [ 8102.847085] NEGADO: IN=eth0 OUT= MAC= SRC=172.16.69.3 DST=172.16.69.255 LEN=149 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=17500 DPT=17500 LEN=129 

* Last few reboots (last -x -n10 reboot runlevel):
     runlevel (to lvl 5)   3.1.0-0.rc8.git0 Sat Oct  8 21:45 - 00:00  (02:14)
     reboot   system boot  3.1.0-0.rc8.git0 Sat Oct  8 21:45 - 00:00  (02:15)
     runlevel (to lvl 5)   3.1.0-0.rc8.git0 Fri Oct  7 14:40 - 22:35  (07:54)
     reboot   system boot  3.1.0-0.rc8.git0 Fri Oct  7 14:39 - 22:35  (07:55)
     runlevel (to lvl 5)   3.1.0-0.rc8.git0 Thu Oct  6 22:35 - 00:56  (02:21)
     reboot   system boot  3.1.0-0.rc8.git0 Thu Oct  6 22:34 - 00:56  (02:21)
     runlevel (to lvl 5)   3.1.0-0.rc8.git0 Thu Oct  6 13:28 - 22:35  (09:07)
     reboot   system boot  3.1.0-0.rc8.git0 Thu Oct  6 13:27 - 00:56  (11:28)
     runlevel (to lvl 5)   3.1.0-0.rc8.git0 Thu Oct  6 12:28 - 12:49  (00:21)
     reboot   system boot  3.1.0-0.rc8.git0 Thu Oct  6 12:28 - 12:49  (00:21)    

     wtmp begins Sat Sep 10 11:04:31 2011

* YUM Repositories (yum -C repolist):
     Loaded plugins: downloadonly, fastestmirror, langpacks, presto, refresh-
                   : packagekit
     repo id                       repo name                                   status
     brew                          Brew Buildsystem for Fedora 16 - x86_64          4
     fedora                        Fedora 16 - x86_64                          24,906
     fedora-debuginfo              Fedora 16 - x86_64 - Debug                   5,639
     google-chrome                 google-chrome                                    3
     google-earth                  google-earth                                     1
     google-talkplugin             google-talkplugin                                1
     rpmfusion-free-rawhide        RPM Fusion for Fedora Rawhide - Free           394
     rpmfusion-nonfree-rawhide     RPM Fusion for Fedora Rawhide - Nonfree        164
     updates-debuginfo             Fedora 16 - x86_64 - Updates - Debug             0
     updates-testing               Fedora 16 - x86_64 - Test Updates            6,541
     updates-testing-debuginfo     Fedora 16 - x86_64 - Test Updates Debug      1,196
     repolist: 38,849

* YUM Extras (yum -C list extras):
     Loaded plugins: downloadonly, fastestmirror, langpacks, presto, refresh-
                   : packagekit
     Extra Packages
     clutter-gesture.x86_64    0.0.2-2.fc13             @koji-override-0/$releasever
     clutter-imcontext.x86_64  0.1.6-4.fc15             @koji-override-0/$releasever
     kernel.x86_64             3.1.0-0.rc6.git0.3.fc16  @updates-testing
     kernel.x86_64             3.1.0-0.rc8.git0.0.fc16  @updates-testing
     kernel-devel.x86_64       3.1.0-0.rc6.git0.3.fc16  @updates-testing
     kernel-devel.x86_64       3.1.0-0.rc8.git0.0.fc16  @updates-testing
     lastfm.x86_64             1.4.2.58240-6.fc11       @rpmfusion-free-rawhide
     nautilus-dropbox.x86_64   0.6.9-1.fc10             @/nautilus-dropbox-0.6.9-1.fedora.x86_64
     opera.x86_64              2:11.51-1087             installed
     pygobject3.x86_64         3.0.1-1.fc16             @updates-testing
     selinux-policy.noarch     3.10.0-36.fc16           @updates-testing
     selinux-policy-targeted.noarch
                               3.10.0-36.fc16           @updates-testing
     skype.i586                2.2.0.35-fc10            @/skype-2.2.0.35-fedora.i586 

* Last 20 packages installed (rpm -qa --nodigest --nosignature --last | head -20):
     iptraf-3.0.1-11.fc15                          Sat 08 Oct 2011 10:37:55 PM BRT
     cups-libs-1.5.0-14.fc16                       Fri 07 Oct 2011 03:43:42 PM BRT
     qt-x11-4.8.0-0.12.20111002.fc16               Fri 07 Oct 2011 03:43:41 PM BRT
     qt-4.8.0-0.12.20111002.fc16                   Fri 07 Oct 2011 03:43:38 PM BRT
     glib2-2.30.0-2.fc16                           Fri 07 Oct 2011 03:43:35 PM BRT
     system-config-date-1.9.66-1.fc16              Fri 07 Oct 2011 03:43:32 PM BRT
     google-chrome-beta-15.0.874.83-104223         Fri 07 Oct 2011 03:43:17 PM BRT
     postgresql-jdbc-9.1.901-1.fc16.1              Fri 07 Oct 2011 03:43:10 PM BRT
     tftp-5.1-1.fc16                               Fri 07 Oct 2011 03:43:09 PM BRT
     tftp-server-5.1-1.fc16                        Fri 07 Oct 2011 03:43:06 PM BRT
     biosdevname-0.3.11-5.fc16                     Fri 07 Oct 2011 03:43:06 PM BRT
     stunnel-4.44-1.fc16                           Fri 07 Oct 2011 03:43:05 PM BRT
     telepathy-salut-0.5.2-1.fc16                  Fri 07 Oct 2011 03:43:04 PM BRT
     qemu-img-0.15.0-5.fc16                        Fri 07 Oct 2011 03:43:03 PM BRT
     telepathy-mission-control-5.9.3-1.fc16        Fri 07 Oct 2011 03:43:02 PM BRT
     gnome-color-manager-3.2.0-3.fc16              Fri 07 Oct 2011 03:43:00 PM BRT
     libmx-1.3.2-1.fc16                            Fri 07 Oct 2011 03:42:59 PM BRT
     clutter-gst-1.4.2-1.fc16                      Fri 07 Oct 2011 03:42:58 PM BRT
     net-snmp-utils-5.7.1-2.fc16                   Fri 07 Oct 2011 03:42:57 PM BRT
     net-snmp-python-5.7.1-2.fc16                  Fri 07 Oct 2011 03:42:57 PM BRT

OK to send? [y/N]: y
Uploading (16.7KiB)...

http://fpaste.org/QL1G/

notebook $>

Abaixo um screenshot da URL gerada:

Era isso tchê!! Simples e fácil!!! E por favor, não cole várias linhas de log/código no IM do seu amigo!! :) Forte quebra costelas tchê!!