{"id":126,"date":"2014-05-03T15:12:09","date_gmt":"2014-05-03T09:42:09","guid":{"rendered":"http:\/\/blog.wnohang.net\/?p=126"},"modified":"2014-05-04T09:51:36","modified_gmt":"2014-05-04T04:21:36","slug":"twitter-setup","status":"publish","type":"post","link":"https:\/\/blog.wnohang.net\/index.php\/2014\/05\/03\/twitter-setup\/","title":{"rendered":"My twitter setup"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><p>I have been using Twitter for a while under the handle <a href=\"https:\/\/twitter.com\/randomsurfer\">randomsurfer<\/a>.<br \/>\nI tend to use web interface sometimes, but regularly I use the command-line\/ncurses interface.<\/p>\n<p>There are two main clients that I use regularly. One is <a href=\"http:\/\/www.floodgap.com\/software\/ttytter\/\">ttytter<\/a><br \/>\nwhich is a nice command-line client which offers advanced functionality such as<br \/>\ncreating\/editing lists and scripting. Refer to the linked page for more scoop. I<br \/>\nwould say ttytter is one of the best implementations of Twitter API. It allows<br \/>\nfor advanced scripting like:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/ronin13\/8593f08a6cb903536cf6.js\"><\/script><\/p>\n<p>The above invocation can be used to get the list of everyone you follow and<br \/>\npopulate the configuration file to allow auto-completion at ttytter prompt. You<br \/>\ncan also run ttytter as a daemon.<br \/>\n<!--more--><\/p>\n<p>Following is how it looks in ttytter for <code>'\/again +50 nytimes'<\/code> which retrieves<br \/>\nlast 50 tweets from @nytimes: (click to magnify)<\/p>\n<p><a href=\"http:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-150028_1920x1060_scrot.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-150028_1920x1060_scrot-1024x565.png\" alt=\"2014-05-03-150028_1920x1060_scrot\" width=\"584\" height=\"322\" class=\"aligncenter size-large wp-image-136\" srcset=\"https:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-150028_1920x1060_scrot-1024x565.png 1024w, https:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-150028_1920x1060_scrot-300x165.png 300w, https:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-150028_1920x1060_scrot-500x276.png 500w, https:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-150028_1920x1060_scrot.png 1920w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>However, the one I use most is actually not a client per<br \/>\nse. I use <a href=\"http:\/\/www.bitlbee.org\/\">bitlbee<\/a>&#8216;s twitter <a href=\"http:\/\/wiki.bitlbee.org\/HowtoTwitter\">plugin<\/a>. If you<br \/>\nhave not heard of bitlbee before, it started as a IM-to-IRC gateway. But, now<br \/>\nit supports more than just IM: bitlbee, skype to name a few. One can write<br \/>\nplugin for any other service, so it is quite pluggable. Now, bitlbee itself is<br \/>\njust a server, you need to connect it to a IRC client.<\/p>\n<p>The IRC client that I use is <a href=\"http:\/\/www.weechat.org\/\">weechat<\/a>. I connect<br \/>\nweechat to bitlbee and thus use twitter from that. This was the setup till<br \/>\nsometime. But, then I wanted to keep the backlog even when I close the client.<br \/>\nSo, I started using IRC bouncer. <a href=\"http:\/\/znc.in\/\">znc<\/a>is the most popular one<br \/>\nand the one I use. So, using bouncer + bitlbee + weechat allows me to connect to<br \/>\ntwitter anytime like an IRC channel (literally!) and also retrieve backlog and<br \/>\nwhat not.<\/p>\n<p>This is how it looks: (click to magnify)<br \/>\n<a href=\"http:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-143208_1920x1060_scrot.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-143208_1920x1060_scrot-1024x565.png\" alt=\"2014-05-03-143208_1920x1060_scrot\" width=\"584\" height=\"322\" class=\"aligncenter size-large wp-image-133\" srcset=\"https:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-143208_1920x1060_scrot-1024x565.png 1024w, https:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-143208_1920x1060_scrot-300x165.png 300w, https:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-143208_1920x1060_scrot-500x276.png 500w, https:\/\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/2014-05-03-143208_1920x1060_scrot.png 1920w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>If you see above, the tweets have identifiers of the form<br \/>\n<code>[0..9a..f][0..9a..f]<\/code>. These are used to reply or favorite (ie. like <code>reply<br \/>\nd8<\/code>) a tweet and &#8216;post &#8230;.&#8217; to post a tweet. Actually, bitlbee allows for<br \/>\nfull IRC mode wherein you don&#8217;t need to say &#8216;post&#8217; to post a tweet but I have<br \/>\ndisabled it to disallow any fat-fingered tweets!<\/p>\n<p>In addition, I want to use some of the features of IRC since I am using it<br \/>\ninside an IRC client. So, next, I thought of using highlights. Highlight is<br \/>\nwhere the tweet is highlighted with the user in that weechat buffer. Weechat<br \/>\nallows to configure per-buffer settings and with buffer_autoset script I use<br \/>\nhighlight_regex to get custom highlights.<\/p>\n<pre><code> \"PXC|[[a-z0-9]{2}-&gt;[a-z0-9]{2}]|xtradb cluster|wnohang.net|wnohang|Raghu|Galera|Raghavendra\" \n<\/code><\/pre>\n<p>is an example of what I use (though not complete). If you see the second one<br \/>\nthere, it has an arrow <code>'-&gt;'<\/code> in it. That allows for me to get highlights<br \/>\nfor replies. Pretty cool, isn&#8217;t it? To add to this, I also have notify_send<br \/>\n(libnotify) hooked into this (through another weechat script I wrote) which<br \/>\nnotifies me on selective tweets (no replies here :)). Sometimes I turn off<br \/>\nlibnotify notifications (I use a wrapper around notify_send), in those cases,<br \/>\nthe window manager urgency hints<sup id=\"fnref-126-1\"><a href=\"#fn-126-1\" rel=\"footnote\">1<\/a><\/sup>(I use xmonad) are used to notify me (in<br \/>\nxmobar).<\/p>\n<p>In addition to above, using twitter inside weechat allows for other IRC client<br \/>\nfeatures like logging, split modes, colors (with rainbow script), easy switching<br \/>\nof buffers (with go script) and so on.<\/p>\n<p>Yes, I use the twitter mobile app and twitter site itself sometimes, especially<br \/>\nI want to look at inline media or the ads (kidding!). Let me know in comments if<br \/>\nyou have any similar setups and\/or any cool hacks you have!<\/p>\n<div class=\"footnotes\">\n<hr \/>\n<ol>\n<li id=\"fn-126-1\">\nThe notification and visual bell involving xmonad, tmux and rxvt-unicode<br \/>\nis bit more complex. I had to modify tmux for this, not sure how it works<br \/>\nupstream, but I have made it bell both the terminal (ie. show a highlight in<br \/>\ntmux) and also report to xmonad.&#160;<a href=\"#fnref-126-1\" rev=\"footnote\">&#8617;<\/a>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>I have been using Twitter for a while under the handle randomsurfer. I tend to use web interface sometimes, but regularly I use the command-line\/ncurses interface. There are two main clients that I use regularly. One is ttytter which is a nice command-line client which offers advanced functionality such as creating\/editing lists and scripting. Refer &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.wnohang.net\/index.php\/2014\/05\/03\/twitter-setup\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;My twitter setup&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[24,26,27,29,28,25,22,23],"class_list":["post-126","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bitlbee","tag-cli","tag-highlight","tag-kiss","tag-notification","tag-ttytter","tag-twitter","tag-weechat"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3AlYV-22","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":349,"url":"https:\/\/blog.wnohang.net\/index.php\/2022\/12\/11\/weekend-with-chatgpt\/","url_meta":{"origin":126,"position":0},"title":"Weekend with ChatGPT","author":"Raghavendra","date":"December 11, 2022","format":false,"excerpt":"A few days ago, OpenAI released a chat-based model called\u00a0ChatGPT\u00a0and provided an interface for users to interact with. ChatGPT is a form of conversational AI where you can ask questions or have a conversation with a bot backed by a model. As per the announcement - The dialogue format makes\u2026","rel":"","context":"In \"ai\"","block_context":{"text":"ai","link":"https:\/\/blog.wnohang.net\/index.php\/tag\/ai\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2022\/12\/Screenshot-2022-12-11-at-20.11.10.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2022\/12\/Screenshot-2022-12-11-at-20.11.10.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2022\/12\/Screenshot-2022-12-11-at-20.11.10.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2022\/12\/Screenshot-2022-12-11-at-20.11.10.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2022\/12\/Screenshot-2022-12-11-at-20.11.10.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2022\/12\/Screenshot-2022-12-11-at-20.11.10.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":114,"url":"https:\/\/blog.wnohang.net\/index.php\/2014\/05\/03\/annoying-access-keys-web-pages\/","url_meta":{"origin":126,"position":1},"title":"Annoying access keys on web pages","author":"Raghavendra","date":"May 3, 2014","format":false,"excerpt":"HTML access keys were introduced to improve web accessibility and they still seem to serve that purpose. Wikipedia defines them as \"In a web browser, an access key or accesskey allows a computer user to immediately jump to a specific part of a web page via the keyboard.\" If you\u2026","rel":"","context":"In \"accesskey\"","block_context":{"text":"accesskey","link":"https:\/\/blog.wnohang.net\/index.php\/tag\/accesskey\/"},"img":{"alt_text":"5463604427_8e7998ddcc_b","src":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/5463604427_8e7998ddcc_b.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/5463604427_8e7998ddcc_b.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/5463604427_8e7998ddcc_b.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/5463604427_8e7998ddcc_b.jpg?resize=700%2C400 2x"},"classes":[]},{"id":73,"url":"https:\/\/blog.wnohang.net\/index.php\/2014\/05\/03\/mysql-file-limit-table-cache-max_connections\/","url_meta":{"origin":126,"position":2},"title":"MySQL file limit, table cache and max_connections","author":"Raghavendra","date":"May 3, 2014","format":false,"excerpt":"MySQL variables open_files_limit, table_open_cache and max_connections are inter-related, and this is for obvious reasons: all deal with file descriptors one way or another. If one of the value is provided but others are left out, mysqld calculates others using a formula and in some cases, emits a warning if not\u2026","rel":"","context":"In \"EAGAIN\"","block_context":{"text":"EAGAIN","link":"https:\/\/blog.wnohang.net\/index.php\/tag\/eagain\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/384027019_5e64727276_z.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/384027019_5e64727276_z.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2014\/05\/384027019_5e64727276_z.jpg?resize=525%2C300 1.5x"},"classes":[]},{"id":195,"url":"https:\/\/blog.wnohang.net\/index.php\/2015\/05\/05\/debugging-docker-containers-with-gdb-and-nsenter\/","url_meta":{"origin":126,"position":3},"title":"Debugging docker containers with gdb and nsenter.","author":"Raghavendra","date":"May 5, 2015","format":false,"excerpt":"Many a time you feel the need to debug a process running inside the container with gdb (or anything that uses ptrace). It is not as straightforward (at least for now) as attaching gdb to host pid of the container process or to docker client\/daemon. You can go about in\u2026","rel":"","context":"In &quot;tech&quot;","block_context":{"text":"tech","link":"https:\/\/blog.wnohang.net\/index.php\/category\/tech\/"},"img":{"alt_text":"GDBLogo","src":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2015\/05\/GDBLogo.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":334,"url":"https:\/\/blog.wnohang.net\/index.php\/2020\/05\/22\/gossips-in-distributed-systems-physalia\/","url_meta":{"origin":126,"position":4},"title":"Gossips in Distributed Systems:  Physalia","author":"Raghavendra","date":"May 22, 2020","format":false,"excerpt":"I often take notes and jot down observations when I read academic\/industry papers. \u00a0 Thinking of a name for this series \u2018Gossips in Distributed Systems\u2019 seemed apt to me, inspired by the gossip protocol with which peers in these systems communicate with each other which mimics the spread of ideas\u2026","rel":"","context":"In \"availability\"","block_context":{"text":"availability","link":"https:\/\/blog.wnohang.net\/index.php\/tag\/availability\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-22-at-4.40.40-PM.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-22-at-4.40.40-PM.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-22-at-4.40.40-PM.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-22-at-4.40.40-PM.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.wnohang.net\/wp-content\/uploads\/2020\/05\/Screen-Shot-2020-05-22-at-4.40.40-PM.png?resize=1050%2C600&ssl=1 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":9,"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/posts\/126\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wnohang.net\/index.php\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}