The wonders of pastebin

These last days, i’ ve been using pastebin intensively, for things like diffs reviews, code snippets to discuss, etc.

And i got sick of the web interface.

So i took a couple of hours to write this nice python script which allows to upload seamlessly any content to pastebin.ca, and maybe it will be useful for other people than me, so i publish it here.

Very simple to use here is the usage():

$ pastebin [OPTIONS] [FILE]

Print the pastebin.ca URL of the input file

If FILE is omitted content is read from standard input
OPTIONS:
        -h, --help                      Print this help notice.
        -r, --raw                       Retreive raw text URL (default=off).
        -d, --description       The description of the content (default=empty).
        -m, --message           Same as description
        -n, --name                      Your name (default=your unix username).
        -t, --type                      The type of the content (default="raw")

        Type can be one of:
        raw, asterisk, c, cpp, php, perl, java, vb, csharp,
        ruby, python, pascal, mirc, pli, xml, sql, scheme,
        ascript, ada, apache, nasm, asp, bash, css, delphi, html, js,
        lisp, lua, asm, objc, vbnet

        If type is not specified, an attempt to auto-detect type is made,
        based on file data/extension. Detection is more reliable when giving FILE
        argument than piping directly. This needs modules gnomevfs and gtksourceview

        If you have module gtk, the pastebin url will be placed in your clipboard,
        you can then paste it with ctrl-v as usual.

That means you can cat important-patch.diff|pastebin -m 'look!' then Ctrl-v in xchat or wherever the output URL.

22 Responses to “The wonders of pastebin”

  1. For pastebin.com-like sites I have created a script just like it (it’s even python) a few months ago – http://www.ubuntulinux.nl/files/pastebin

  2. Ikke says:

    Cool stuff!

    Ikke

  3. pvanhoof says:

    Using it! Thanks a log

  4. pvanhoof says:

    Err, lot. Not log :-)

  5. MacSlow says:

    Very nice! But the automatic inclusion in the clipboard of the generated pastebin-URL doesn’t work for me. Or do I misunderstand this here:

    “… you can cat important-patch.diff|pastebin -m ‘look!’ then Ctrl-v in xchat…”

    I still have to mark the outputted URL from the pastebin-script explicitly in order to get in in the clipboard.

    Thanks anyway for this nice python-gem!

    Best regards…

    MacSlow

  6. rejon's blog says:

    Wed

    I’ve noted a few links about an individual dev. on the gimp who is wreaking havoc for them. Talk about a crank!

    I’ve found the best way to deal with issues like this is offlist. However, if this kind of thing persists (which I haven’t had to deal…

  7. Anonymous says:

    nice

  8. jake says:

    Tha author wrote:
    maybe it will be useful for other people than me

    “Maybe” ??
    This is pure shell genious.
    At first it died on me, funky error message, probably did something illegal, but now it works like a charm.

    Now, the question is, would it be possible to use the setting over at pastebin.ca that forces the paste to expire after X time? In the default state, i think the paste stays there forever and i think thats unnecessary.

  9. kikidonk says:

    It’s easily done, just modify the
    # Default Values
    [...]
    expiry = “”

    to

    # Default Values
    [...]
    expiry = “5 minutes”

    or any other string found in the EXPIRATIONS array on top of the file

  10. jake says:

    kikidonk: thank you! fantastic!

  11. [...] While browsing the archives of Raphael Slinckx’ blog, among other very interesting things, I came across a post about a Python script of his, which uploads a text file on the on-line pastebin pastebin.ca. A neat script like this proves to be extremely useful sometimes. [...]

  12. Marc says:

    Nice, thank you

  13. Azzurra says:

    Buon luogo, congratulazioni, il mio amico!

  14. alex says:

    hi nice site.

  15. NightStrike says:

    Is there any way to make the expiration command-line driven?

  16. denispopko says:

    Продаю Люстру Чижевского. Ионизация, Франклинизация, Ионотерапия. http://ionization.at.ua/
    Аэроионификация — электротехническая проблема искусствен­ного создания внутри жилых и вообще населенных помещений такого электрического режима воздуха, которым характеризуется воздух лучших местностей и курортов, славящихся своим благотворным дей­ствием на организм человека.

  17. Marlasarla says:

    For many years, there are a number of controversies in the tax treatment of transactions in the software. The case has become increasingly relevant in view of rapidly evolving computer technology and increased international trade in computer programs. The main problem is lack of clarity as to the proper qualifications duties paid by way of computer transactions.
    Admission

    The subject of this article is to try to determine when fees for computer programs can be regarded as royalties for the purposes of commentary on art. 12 OECD Model Tax Convention, and when as an ordinary sprzeda¿1.

    Commentary on Article. 12 states that pay for computer programs generated against the copyright license fees are the only ones that can be regarded as royalties (paragraph 13.1 Commentary). Many countries importing capital, however, disagrees with the method and in addition to restrictive copyright licensing fees also considers licensing fees for computer programs that do not involve copyright. Problem arises, however, that there is no certainty what the copyright in relation to a computer program and when such rights are licensed, and when sold. Commentary on Article. 12 does not include clear guidelines and devotes only a few lines of content analysis of copyright in relation to computer programs and the differences between licensing and sale of such rights. It is expected that in the near future the problem of licensing fees for computer programs will be studied again in the commentary to art. 12 in terms of:

    a) determination of the exact content of copyright for computer programs in terms of income tax qualification, and

    Opera

    b) clearly outlined the borders between the licensing and sale of those rights.

    U.S. tax legislation adopted in 1998, the provisions on computer programs, which are based on versions of the commentary to art. 12 of 2000 and 2003. This can be deduced from a comparison of U.S. laws and the relevant paragraphs of the Commentary to Article. 12 Model Konwencji2.
    The importance of qualifications for the computer program fees as royalties

    As part of ongoing information and communications technology company engaged in the computer industry are among the fastest growing. Thus, the transfer software is a problem of immense economic importance with substantial consequences podatkowymi3.

    It is of great importance to carry out the demarcation between the license fees (Article 12) and other types of income, which are often mistaken for license fees, such as corporate profits (Article 7), gains from the alienation of property (Article 13) or income of professions (Article 14).
    Avast
    Most of the Convention provides for taxation of tax by the state licensing fees and the source country of residence, while the remaining income tax is allowed only by the state of residence, assuming the plant. Therefore, the source state is entitled to tax royalties withholding tax, but only within the limits set by the Conventions. Other types of income such as profits of the enterprise, the gains from the alienation of property and income from professional services shall be taxable only in the country of residence.

    With regard to the Model Tax Convention, the OECD Model Convention establishes the taxation of royalties in the country of residence. Capital exporting countries use this method, while capital importing countries apply the UN Convention A model and prefer the division of the right to tax between the state of residence and state sources. In the context of the OECD Model demarcation of the boundary between license fees and other parts of the income is not as important as the royalties are applied the same principles of taxation, like other elements of income, of which the royalties are often confused. However, the OECD takes into account the different rules for the distribution rights to the taxation of royalties and other fees applicable to most tax Convention, and therefore extends the commentary on Article. 12 with a few lines, considering fees for software license fees.

  18. Adamsek says:

    Down payment – this is one of banking products, which offers us the possibility to save. Offers is more and more, we force a choice of prejudicial figure and duration of the deposit.

    lokaty terminowe
    On the deposit reject our upper case, which greater than the next months, years, germaneness provoke is growing and rate is charged. We do not have the conceivability to from our change, we can realize together with drawn to at the end of the contract. Early termination of the accord is exceptionally bad because we bested all interest.

    Aig lokata
    Uncomfortable, we can acquire as the days from 2 to 60 months. The value amount is as a rule fixed. We can obviously employ an investment in a currency other than our domestic, which is a very good choice through despite those working and receiving gains from abroad.

  19. Kontownik says:

    Bosom account – as the luminary suggests, must be chiefly to happen on our expectations and needs. Assuming they are trying to patch up all the options offered past the bank, into our particular habits. Object of each customer of the bank is important as the lowest gauge inasmuch as account perpetuation, and flexible access to it. Bids pro the fiscal conducting is very much bank customers can determine and customize the capabilities of accounts according to their special functions.

    Assuming a bank account, come what may, we should before all of all lengthen publicity to the zenith of all kinds of fees and commissions. Fees are at ease primarily in compensation maintaining the account, over on easy street (whether made directly in the bank and the online e-account), also in compensation issuing a payment card or credit card. The commissions also day in and day out refer to ATM withdrawals, in which the truth there is in many cases a difference between ATM withdrawals from our bank (which may be accessible of custody) and other banks. As we glom, the options are altogether much, so it is needful to look like the bids of banks and see which options are most profitable in behalf of us.
    Konto deutsche Bank
    Another signal feature to recall is the savings account populating, or ROR. It allows us gratis access to the account, and in it – affects the enlargement evaluate, which may wrap the costs associated with match a bank account. ROR is recommended payment people who actively use the account, making scads transactions, which facilitates obtaining additional credit. Should ergo also reflect on wysokooprocentowanym ROR-I, which brings many benefits for users of individual accounts.

    It is also important that in your area be experiencing a part of his bank, which we reported in various situations, as admirably as ATMs. It’s deeply efficient to acquire ATM in the view where we expend the most. In the occasion of unexpected circumstances easy access to the account can be extraordinarily helpful. Most banks tender their customers the break to conduct an Internet account. This is a altogether practical service to facilitate touchy and easy in search us to block the state of their finances, construct transfers, or miscellaneous other operations in any place where we are.

  20. fortis.kh says:

    Тротуарная плитка Харьков, еврозаборы Харьков

  21. сертификация iso, система качества, проведение семинаров ISO 9001

Leave a Reply