background preloader

cURL - Tutorial

cURL - Tutorial
cURL Docs Tutorial HTTP Scripting 1.1 Background1.2 The HTTP Protocol1.3 See the Protocol1.4 See the Timing1.5 See the Response 2.1 Spec2.2 Host2.3 Port number2.4 User name and password2.5 Path part Fetch a page HTML forms 4.1 Forms explained4.2 GET4.3 POST4.4 File Upload POST4.5 Hidden Fields4.6 Figure Out What A POST Looks Like HTTP upload HTTP Authentication 6.1 Basic Authentication6.2 Other Authentication6.3 Proxy Authentication6.4 Hiding credentials More HTTP Headers 7.1 Referer7.2 User Agent Redirects 8.1 Location header8.2 Other redirects Cookies 9.1 Cookie Basics9.2 Cookie options 10.1 HTTPS is HTTP secure10.2 Certificates Custom Request Elements 11.1 Modify method and headers11.2 More on changed methods Web Login 12.1 Some login tricks Debug 13.1 Some debug tricks References 14.1 Standards14.2 Sites 1. 1.1 Background This document assumes that you're familiar with HTML and general networking. Curl is not written to do everything for you. 1.2 The HTTP Protocol The client, curl, sends a HTTP request. or 3. Related:  commandlines

How To Look Like A UNIX Guru Terence Parr Last updated: August 30, 2006 Translations: UNIX is an extremely popular platform for deploying server software partly because of its security and stability, but also because it has a rich set of command line and scripting tools. If you want to be a serious server developer, you will need to have a certain facility with a number of UNIX tools; about 15. This lecture takes you through the basic commands and then shows you how to combine them in simple patterns or idioms to provide sophisticated functionality like histogramming. [By the way, this page gets a lot of attention on the net and unfortunately I get mail from lots of people that have better solutions or stuff I should add. Everything is a stream The first thing you need to know is that UNIX is based upon the idea of a stream. Here is an example device, the null device, that lets you throw output away. $ ls > /dev/null # ignore output of ls where "# ignore output of ls" is a comment. $ ls -l | grep Aug | wc -l Getting help

HTTPBuilder In working with a RESTful web service that allows PUT requests to upload files, I came across an slight annoyance with the put() convenience method in the Groovy RESTClient. Up until now, I've been absolutely amazed with how easy RESTClient makes my life in working with RESTful web services, and I'll continue to use it in doing REST development. However, in this one case, RESTClient wouldn't work nicely for me. Here's the scenario: I upload a zip file to the service so that it can use the data in that file to populate some things (see my post Groovy, RESTClient, and PUTting zip files for one way to get RESTClient to handle zip files). Here's what the Groovy code looked like at this point: It turns out that the RESTful service, once it gets the file, just sends back an HTTP "201 Created" response code. Since I didn't see a way of telling RESTClient not to expect a response body, I could have just lived with the exception, catching it and moving along.

MacPorts Guide Linux Shortcuts and Commands (Highly recommended) Next: About this document ... Up: Linux Newbie Administrator Guide Previous: Before Linux Installation Contents Subsections Maybe this should have come first. A practical selection of Linux shortcuts and commands in a concise form. Perhaps this is everything that a computer-literate newbie Linuxer really needs. Moving around your Linux computer Shortcuts and commands to help you get around your computer like a pro. Switch to the first text terminals. <Ctrl><Alt><Fn> (n=1..6) Switch to the nth text terminal. tty Print the name of the terminal in which you are typing this command. Switch to the first GUI terminal (if X-windows is running on the 7th terminal, where it typcially is). <Ctrl><Alt><Fn> (n=7..12) Switch to the nth GUI terminal (if a GUI terminal is running on screen n-1). Command-line Shortcuts Command-line shortcuts and commands. . Current directory. .. Directory parent to the current one. (tilde character) My home directory (normally the directory /home/my_login_name). reset exit pwd w

cURL and libcurl how to survive in vi and emacs some basic vi commands. :set nu show line numbers. :set ic ignore case differences when searching. :set ai set automatic indent. :set sm show matching ( or { with ) or } in insert mode. down-arrow up-arrow move down/up 1 line. right-arrow left-arrow move right/left 1 character column. 0 $ go to 1st/last column of current line. return go down to 1st printable character of next line. nw nb move right/left n words (1 word if n omitted). ng go to line n (end of file if n omitted). ctrl-f ctrl-b page forward/backward 1 screen. ctrl-d ctrl-u page forward/backward half a screen. [[ ]] go to beginning of current/next c function. emacs survival guide. emacs has a vast range of commands, this is just a very brief personal selection of the ones i use most often.

Seders's grab bag - Tutorials If you have written anything about sed - whether an introduction, how sed got you out of a real-life situation, or perhaps an advanced technique you've discovered - you may like have your work published here. Your contribution will be very welcome. Intros sed one-liners (18kb) The essential, official compendium of useful sed one-liners. The sed FAQ v15 (168kb) Another sed FAQ And here is another sed FAQ, by a different person. Do it with sed (51kb) By Carlos Jorge G.Duarte. SED - A Non-interactive Text Editor (32kb) By Lee E. Program state in sed (4kb) By Greg Ubben. Introduction to Unix's SED editor By F. Advanced topics Using sed to create a book index (12kb) Eric Pement of Cornerstone magazine shows how he used sed and other utilities to massage an unsorted list of book references into an index. Using lookup tables with s/// (9kb) Part 1 of Greg Ubben's analysis of a complex sed script he wrote to sort, delimit and number an input file containing tabulated data. A lookup-table counter (11kb)

Swiss Army Knives: cURL &amp; tidy « Gnip Blog Iterating quickly is what makes modern software initiatives work, and the mantra applies to everything in the stack. From planning your work, to builds, things have to move fast, and feedback loops need to be short and sweet. In the realm of REST[-like] API integration, writing an application to visually validate the API you’re interacting with is overkill. cURL can generate custom HTTP client requests with any HTTP method you’d like. POSTing Some APIs want data POSTed to them. Inline curl -v -d "some=data" " From File curl -v -d @filename " In either case, cURL defaults the content-type to the ubiquitous “application/x-www-form-urlencoded”. curl -v -d "someotherkindofdata" " --header "Content-Type: foo" Authentication Passing HTTP-basic authentication credentials along is easy. curl -v -uUSERNAME[:PASSWORD] " Show Me Everything You’ll notice I’m using the “-v” option on all of my requests.

Tutorial completo do apt-get No começo existia o código fonte. Você baixava um pacote .tar.gz, contendo o código fonte do programa, e a instalação consistia em compilar e instalar os executáveis gerados na sua máquina. Esta forma de distribuição faz sentido em se tratando de aplicativos abertos, pois permite que você veja e até adapte o código fonte se necessário, para que ele rode na sua máquina. Em muitos casos, é possível instalar o programa em outro sistema operacional (a maior parte dos programas do Linux podem ser instalados no BSD, com pequenas adaptações) ou até mesmo em outras plataformas. O problema é que instalar programas a partir dos fontes é demorado e nem sempre simples, já que você precisa ter instalados uma grande quantidade de compiladores e bibliotecas, necessários para compilar os mais diversos programas. Compilar significa transformar o código fonte, escrito pelo programador, nos arquivos binários que são executados pelo sistema. Os pacotes são uma idéia muito simples. # apt-get update

» Linuxaria – Everything about GNU/Linux and Open source Understanding Nmap Commands: In depth Tutorial with examples Article by James Hawkins As we all know, Nmap (Network Mapper) is a stealth port scanner widely used by network security experts (including forensics & Pen-testing Experts). In this article we’ll see the different types of Nmap Scans, its techniques, understanding the purpose and goals of each scan , its advantages or disadvantages over other scanning tools, which could be better at evading firewalls & IDS (To a certain extent) and much more. In this first part, I have made my best to explain the basic scanning techniques, Host discovery options, port scanning options, techniques used in detecting Operating system & services running on the system. i also give Nmap as already installed on your system. Let’s start with one of the most basic and default scan, the one without using any parameters. This is a basic scan of the local IP address 192.168.1.34, we use sudo to gain administrator privileges, and then we give the target to Nmap. Discovery Port scanning options Performing Fast scan:

Best Linux Software You’ve made the switch from Windows or Mac OS X, and now you’re looking for applications to install. Or maybe you’re a long-time Linux user who’s keeping an eye out for what’s new. Either way, you’ve come to the right place. You’ve already picked a Linux distro and have settled on a desktop environment. Those are the big choices that determine what software you start with and what will run best on your machine. Most of the software below is free and open source. A few require you to download an installer from a website. Browsers Firefox With the new Quantum update, Mozilla has given people reason to check out Firefox again. 9 Reasons to Switch From Chrome to Firefox 9 Reasons to Switch From Chrome to Firefox The days when Chrome was the best browser are long gone. Chrome/Chromium By some measures, Chrome is now the king of the hill. How to Decide If a Chromebook Is Right For You How to Decide If a Chromebook Is Right For You Is a Chromebook for everyone? Opera Web (Epiphany) Browser QupZilla

Linux dd Command Show Progress Copy Bar With Status byVivek GiteonOctober 20, 2012 last updated December 31, 2014 I'm using dd command for block level copy and just found out that there's no built in way to check the progress. How do I use the Linux or Unix dd command while coping /dev/sda to /deb/sdb and display a progress bar when data goes through a pipe? You need to use the pv command which allows you to see the progress of data through a pipeline. WARNING! Copy /dev/sda to to /dev/sdb: pv -tpreb /dev/sda | dd of=/dev/sdb bs=64M pv -tpreb /dev/sda | dd of=/dev/sdb bs=4096 conv=notrunc,noerror Sample outputs: Fig.01: pv and dd in action (pv -n /dev/sda | dd of=/dev/sdb bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0 Fig.02: Show the Status of dd Command in progress using pv and dialog command

Related: