Latest version
Stanley Black & Decker (SWK) has an impressive earnings surprise history and currently possesses the right combination of the two key ingredients for. Swf Download free download - Download App, PDF Download, Sothink SWF Decompiler, and many more programs.
Released:
Extendable command line utility for sysadmins
Project description
An extendable utility with plugins for doing everything withself-defined hosts/hostgroups, utilizing API of your environment, withparallel ssh out of the box.
Destroying all your databases at once has never been this simple!
(yeah, you really shouldn't do that in production environment. Unlessyou're angry and desperate.)
Please update
If you're using swk older than v0.0.4a13, please update to thelatest version. There's a whole lot of bugfixes every week, asdevelopment's in progress, thus I've included auto check for updatesfunction. It runs once a day when you run swk, and outputs to stderr ifnewer version is available. You can turn it off by setting‘check_for_updates' to anything but ‘yes' in swk.ini .
What can it do?
The basic idea is: you specify what to do (a command), a list of hostsor hostgroups to do that with, and additional arguments if needed(depends on what you want to do). You can easily define your owncommands through the plugin interface, as well as your own hostgroupparsers (usually they'll just ask some API in your environment aboutwhich hosts are included in provided hostgroup). Basic Foreman, ZabbixAPI and ssh functions are supported out of the box.
Please note that this is notfabric (though it uses paramiko,both are marvellous pieces of software), and this is notpssh (ituses its own way of parallelling ssh sessions, and its own outputhandling). This utility is designed to work in small environments andperform ad-hoc operations, it's very easy to use (not harder than shell)and to configure, it has no learning curve, and it provides a way toexecute quick-and-dirty commands on a lot of hosts at hand. You maythink of it as of a version of ansible -a that requires very littleeffort to get usable in your infrastructure (writing parsers to getadvantage of tools dividing your hosts to hostgroups) or no effort atall if you happen to use Foreman, Zabbix or third-party host groupingtools.
Installation
If you need plugins for casp, Foreman or Zabbix, also run
Upon first execution `swk`` will create ~/.swk directory, whereyou should find swk.ini configuration file, and that's used to storeshell mode command history, program's log, various plugins' cache, etc.
Please note that you should use python3.3+ for shell mode to work.Everything else should work with python2.7.6+. You probably may have toupdate pip and setuptools(pip install --upgrade pip setuptools). You also may have to do allof these with sudo, or fall into your virtualenv if you use one.
Usage
Typical usage looks like
swk pssh '%hostgroup1[ [-]^hostgroup2 . host1 [-]host2]' uptime
which executes uptime on all the hosts over ssh in parallel fashion.
%, ^ and other non-alphabetical characters are treated ashostgroup modifiers which indicate which parser should expand a givenhostgroup into a host list. hyphen (-) in front of hostgroup or ahost means that hostgroup or host will be excluded from resulting list.A host may be a simple regex (no * quantificator or anychar (.), nolookahead/lookbehinds), swk will generate strings that match it anduse it as hosts. If you're excluding hosts that aren't included yet,nothing happens. Hostlist is expanded from left to right. Example:
swk pssh '^g1 -host[1234]' echo Yay
Swk download free. full
will execute echo Yay in parallel fashion on each host that's inzabbix hostgroup g1 except hosts host1, host2, host3 andhost4. Screens 4 3 7 – access your computer remotely settings.
Available and bundled plugins
From the box, swk supports: - running commands over ssh (ssh andpssh commands), copying files over ssh to multiple hosts (distcommand, recursive and without preserving times by default), copyingfiles from multiple hosts over ssh (gather) - and just displayingresults of hostlist expansion (dr for ‘dry-run')
By installing additional packages named swk-, you alsoget - expanding zabbix hostgroups (^ modifier), listing, addingand removing maintenance periods in Zabbix (lsmntnce, addmntnceand rmmntnce commands) - expanding casp hostgroups (%modifier), special ALL hostgroup expanding to all the hosts -getting and setting hosts environments in Foreman (getenv andsetenv commands), getting, adding and removing classes linked tohosts and hostgroups (getcls, addcls, rmcls, getgcls,addgcls, rmgcls respectively), searching hosts and hostgroupsbased on given criteria (srch and srchg), listing availableclasses (lscls) and describing hosts (desc).
To install them, please refer to Installationsection above. Also, please read Usage notes belowbefore using.
Don't forget to make changes to your swk.ini before using plugins(credentials/urls and such).
Hopefully, there are more plugins coming.
Examples
Imagine that you need to grep all your frontend nginx logs for string‘/api/do_something'. Your frontend hostnames are frontend00,frontend01, …, frontend99. You could use something like
swk pssh frontend[0-9][0-9] grep '/api/do_something' /var/log/nginx/access.log
You can interrupt the command execution at any moment with Ctrl-C.
Swk Download Free Pc
Suppose your servers are named a bit more sophisticated, likefrontend01, frontend02, …, frontend25. This command woulddo the trick (note the quotes around host expression):
swk pssh 'frontend([0-1][0-9]|2[0-5])-frontend00' grep '/api/do_something' /var/log/nginx/access.log
You can always verify if you did the host expression right:
swk dr 'frontend([0-1][0-9]|2[0-5])-frontend00'
Output:
Suppose you also have servers backend01, backend02, …,backend10, and you want to run uptime on both frontends andbackends. Try this one:
swk pssh 'frontend([0-1][0-9]|2[0-5])-frontend00backend(0[1-9]|10)' uptime
Now imagine you have to execute a certain script named test.sh Pdf squeezer 3 10 4. onthose 25 frontends locally. First, copy it to target hosts:
swk dist 'frontend([0-1][0-9]|2[0-5])-frontend00' ./my_scripts/test.sh /usr/share/
and then execute it:
swk pssh 'frontend([0-1][0-9]|2[0-5])-frontend00' /usr/share/test.sh
Imagine you need to do something with nginx logs locally on yourcomputer (say, a simple statistics calculation). You can gather all thelogs to your machine with one command:
swk gather 'frontend([0-1][0-9]|2[0-5])-frontend00' /var/log/nginx/access.log ./nginx-logs-from-production
This will create ‘nginx-logs-from-production' directory in your currentworking directory, and copy over all the access.log files, appending asuffix so you can tell from which host each log has been copied. Magic photo eraser 1 61 – erase elements from photos.
Say you have a Zabbix installation in your environment, and all thefrontends are in ‘frontend' hostgroup. You can do the same as aboveusing zabbix hostgroup expansion (note that zabbix module isdisabled by default. More on that in Availableplugins section above)
swk gather ^frontend /var/log/nginx/access.log ./nginx-logs-from-production
You probably already have some cli tools for finding hosts falling undersome search criteria. Suppose you have a tool that's calledmy_awesome_tool which returns some hostnames on call, like this:
If you want to use your tools as a source for hostlists for swk, youcan achieve this in two ways:
or
where - instead of host expression indicates that swk reads fromstdin.
Imagine that you have Foreman installation and you need to set all thefrontends' environments to ‘development' (note that you still use ^here, so host expansion mechanism works with Zabbix hostgroups)
swk setenv ^frontend development
…or add to frontend Foreman hostgroup your brand newnginx::verbose_access_logs Puppet class
swk addgcls frontend nginx::verbose_access_logs
Note: if you have several Foreman hostgroups named the same, butdifferent hierarchically (for example, debian/mysql and mysql),getgcls, addgcls and rmgcls will work with the first groupreturned by Foreman API.
You can also get description on an existing host:
Output:
Or search hosts by a given criteria (Foreman doesn't support everythingfor a search criterias). There are several short keywords forconvenience now: hg for hostgroup, cls for class, env forenvironment and os for OS family (Debian, RedHat etc). Specifyingseveral implies AND logic:
Output:
This way you can combine swk invocations in something really funlike
Remember to use and escape quotes when needed!
swk pssh ^mysql mysql -e 'show variables like 'read_only' won'twork (due to shell quote processing, it representsmysql -e show variables like 'read only'), but
swk pssh ^mysql 'mysql -e 'show variables like 'read_only'' will.
You can get more info on available parsers, commands and arguments byrunning swk -h .
If you need to change your default SSH user, parallel processes count,API credentials or such, take a look at swk.ini file located at~/.swk .
Shell mode
If you run swk without any arguments, it starts in shell mode. Likethis:
You can do absolutely all the same like in command line mode, but inshell mode you don't need to think about quote escaping in trickycommands, because the arguments are treated literally even if notquoted.
For example, that ugly mysql example above would look like this in shellmode:
Additionally, you may call any system utility from inside swk shellvia sys command or even omit sys:
It also supports history through hist command, etc. To get help onany command, issue help or help without arguments toget an overview.
Please note that shell mode doesn't support backticks yet, so if youneed to feed a hostlist to swk from somewhere, you should use stdinapproach:
Details
Commands, hostgroup modifiers and parsers code are defined through swkplugins. They can be connected to the main program in three ways: beingincluded in main package under swk/plugins dir, having a definedswk_plugin entry point in their setup.py and installed or justbeing put in one of plugins_directories dir from swk.ini file.
You can find some working plugins there mentioned above, as well asdummy examples in swk_plugins_examples . Further help can be foundin swk.classes, which you MUST import when defining your own commandand/or parser modules.
For example, if you use Nagios in your environment, you can create aparser that will expand a Nagios hostgroup into a hostlist, or a commandthat will take a Nagios hostgroup and do something with it using NagiosAPI (say, downtime it or something). Information that's used for modulesto work (such as authentication information for various APIs) may (andshould) be stored in config named swk.ini.
Shell mode parsing details
When in shell mode, every argument starting with the third to the endof the line is passed literally even if not quoted, backslashes beingescaped, and then it's shlexed down to a list respectful to quotes. Itsounds a little bit confusing at first, but it has its benefits. You donot need to escape backslash character, and you don't need the outerlevel of quoting when ssh`ing this way.
Please note that these rules work only for swk commands. Everythingelse is passed as you'd expect.
Trade-offs: - you may have to implement your own argument parsing incommand plugins for them to work correctly (using a whitespace orsomething else as a delimiter). - you have to escape chaining/ioredirection characters for those to be passed as arguments to commmandinstead of work locally. For example, ssh remote echo ABC > filecreates file on local machine, but ssh remote echo ABC > filedoes the same on remote.
Why did I do this and why you may need this?
I did it simply because there was no such instruments in my environment,and I needed them from time to time. As a side note, I hate GUIs and webinterfaces for everything that shouldn't be necessary visualized (likeUML or statistic charts). And I just can't accept that I need to make 10mouse clicks to change a host's environment in Foreman when I knowhostname and environment name exactly. So swiss-knife is a simpleinstrument to make simple operations and its functionality can beextended rather easily.
There's a few possible reasons you'll find it useful: - You are a systemadministrator. If you're not, it's doubtfully can be useful for you inany way - You hate clicking GUIs just like me, and your GUIinstrument(s) has an API you could use - There's no such an instrumentin your environment: it's either de-centralized and/or you don't useconfiguration management software and its tools heavily - You'd like toglue altogether all the stuff you use in your environment to classify orgroup hosts and you know a little bit of python
Known issues and notes
As this is an alpha version under development, author wouldn't recommendto think of swk as of a reliable tool suitable for runningimportant, potentially destructive tasks. i.e. restarting/reinstallingimportant services, seding mission critical configs, etc. Alwaysdouble-check command's result on one host before applying it to wholeproduction, use dr command.
No compatibility with future versions is guaranteed yet.
casp is a nice piece of software written by my former colleague StanE. Putrya. It's not yet released to opensource, but I'm sure it willeventually.
swk uses a small part of yolk3k package by Rob Cakebread(sources can be found on github,distribution on pypi) tohandle self-update noticing mechanics. You can turn new version checkingoff by modifying swk.ini parameter ‘check_for_updates' to anythingbut ‘yes'.
It should work on python2.7.6+, python3.3+.
Usage notes
- currently, host cannot start with non-alphanumerical character. Thisbreaks using something like (host|hos)123 as a host expression asleft bracket will be treated as a hostgroup modifier.
- ssh module needs a running ssh-agent with private keys added, orprivate keys need to remain password free
- username for ssh specified in swk.ini will override your currentusername and username from .ssh/config if present
- Ctrl-C works poorly when pssh'ing (providing you unneeded tracebacksfrom multiprocessing)
- interactive user input is NOT supported when running a command
- if you have several Foreman hostgroups named the same, but differenthierarchically (for example, debian/mysql and mysql),getgcls, addgcls and rmgcls will work with the firstgroup returned by Foreman API.
- using dist and gather commands has a little trick: if youwant the name expansion to be done at the remote side instead oflocal by your shell when not in swk shell mode, quote it.
- Foreman srch routines may work not as you expect, because swkrelies completely on Foreman's API. For example,swk srch cls!=myclass won't give neither any useful results norerror, but this is how API is designed. To check if your query reallyworks, try it in the web interface first.
Dev notes
- if a parser doesn't return any hosts, its job is considered failedand desired command doesn't start
- all the information needed to run a command is added to classattributes, more info on that in swk_classes
- all the information you've mentioned in config is also added to classattributes. Section must be named the same as the class that is beingconfigured for this to work; [Main] section is for swk program
- in order to be supported in update checker, your package should havea version.py file with __version__ string determining packageversion.
Dependencies
- for main program: exrexpypsi configparser
- for ssh plugin: paramikoscp
- for swk-casp plugin:requests
- for swk-zabbix plugin:pyzabbix
- for swk-foreman plugin:python-foreman
Contributions
Please do! Don't forget to exclude sensitive details from swk.ini,if any.
- Pavel 'trueneu' Gurkov, 2016
Release historyRelease notifications | RSS feed
0.0.4a18 pre-release
0.0.4a17 pre-release
0.0.4a16 pre-release
0.0.4a15 pre-release
0.0.4a14 pre-release
0.0.4a13 pre-release
0.0.4a12 pre-release
0.0.4a11 pre-release
0.0.4a10 pre-release
0.0.4a9 pre-release
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size swk-0.0.4a18.tar.gz (32.8 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for swk-0.0.4a18.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | b1cea4548c8d01ffec448604ff41743cfd6978e7b87d19cdb5ca4f33c9f03d21 |
MD5 | 26ca5e324da3c6bf0891a85010e6ca0a |
BLAKE2-256 | a587f1908a0a4b75b739f210a4116d05cbbda7b249cabc99ca3bfe9f45e93b6b |
Background information | |
---|---|
Birth name | Solomon Schwartz |
Born | 14 June 1913 Whitechapel, London, England |
Died | 27 November 2002 (aged 89) London, England |
Instruments |
|
Years active | 1930s–2002 |
Labels | Decca |
Stanley BlackOBE (14 June 1913 – 27 November 2002) was an English bandleader, composer, conductor, arranger and pianist.[1] He wrote and arranged many film scores, recording prolifically for the Decca label (including their subsidiaries London and Phase 4). Beginning with jazz collaborations with American musicians such as Coleman Hawkins and Benny Carter during the 1930s, he moved into arranging and recording in the Latin American music style and also won awards for his classical conducting.
Life and career[edit]
Black was born as Solomon Schwartz on 14 June 1913 in Whitechapel, England.[1] His parents were Polish and Romanian Jews.[2] He began piano lessons at the age of seven and trained in piano and composition under Rae Robertson at the Matthay School of Music. He was aged only 12 when his first classical composition was broadcast on BBC Radio.[3] His first professional job was in for a C.B. Cochran 1930 theatrical revue followed by him winning a Melody Maker competition for his arrangement of a jazz chorus the next year.[4]
In the early 1930s, he was employed in dance bands and had worked with Howard Jacobs, Joe Orlando, Lew Stone, Maurice Winnick and Teddy Joyce by the time he joined Harry Roy in 1936.[1] He had also broadcast and recorded with several American musicians, including jazz saxophonists Coleman Hawkins and Benny Carter during their stays in England during this decade.[4] Hawkins had first heard Black on late night radio shows with Lew Stone's band. When the two eventually met in London, the reviewer Edgar Jackson suggested they record together, and the two men collaborated on a duet version of 'Honeysuckle Rose'.
During World War II, Black joined the Royal Air Force, and became involved in managing the entertainment of servicemen based at Wolverhampton. In 1944 he was appointed conductor of the BBC Dance Orchestra, and remained in the job for almost nine years, broadcasting as many as six nights a week.[1]
Black's radio work kept him in contact with a large listening audience, through his incidental music for shows such as Much Binding in the Marsh and the first two series of The Goon Show. He also conducted the BBC Dance Orchestra for the popular comedy show Ray's a Laugh, starring Ted Ray.[5] He later presented his own programmes on radio and television, including Black Magic and The Marvellous World of Stanley Black.[1]
In the early 1950s, he regularly topped the Melody Maker lists of the most-heard musicians on radio. He was chosen to be included on Decca's first release of long-playing records in the UK in June 1950. This enabled him to continue his conducting, arranging and performing career and resulted many albums. He was particularly popular in United States, as evidenced by his inclusion in the Billboard best-sellers lists.[1] During 1968–69, he was principal conductor of the BBC Northern Ireland Orchestra.[4]
Becoming involved with the film industry, he composed and arranged music for about 200 films. He was appointed music director at Elstree Studios in 1958.[1] He was also principal conductor of the studio orchestra of Associated British Picture Corporation (ABPC) and their musical director composer from 1958-1963.
During his life, he conducted many of Britain's major orchestras, and until the 1990s he was still directing regular broadcast sessions at the BBC studios, despite the onset of deafness in later life.
Swk Download Free Download
Honours[edit]
Black received numerous awards, including the OBE. He was made a life fellow of the International Institute of Arts and Letters, and life president of the Celebrities Guild of Great Britain.[1]
In 2003, Decca released a two-CD set, A Tribute to Stanley Black (473 940-2), including recordings from 1951 to 1979.
Personal life[edit]
Black was married to dance band singer Edna Kaye. The couple wed in 1947; they had a son and daughter.[6]
Black died in London, aged 89, on 27 November 2002.
Works[edit]
Black is remembered for writing numerous scores for radio, television and cinema, including the theme-tune for The Goon Show.
Other films he composed scores for include Laughter in Paradise (1951), The Naked Truth (1957), Blood of the Vampire (1958), Too Many Crooks (1958), The Long and the Short and the Tall (1961), West 11 (1963), The System (1964), Crossplot (1969), and the Cliff Richard musicals The Young Ones (1961) and his orchestral backing for Richard's follow up, Summer Holiday (1962), which won him an Ivor Novello Award. His work also became familiar to millions of cinema audiences as a consequence of his theme tune and music library for Pathé News, written in 1960.[7]
He also recorded many classical works, including collections of Tchaikovsky and George Gershwin. In 1965 he won a Gramophone Award for his version of Rimsky-Korsakov's Capriccio Espagnol. In addition, he arranged and conducted many commercially successful albums on LP and later CD like Tropical Moonlight, Cuban Moonlight, Black Magic, and series of Film Spectacular and Broadway Spectacular for Decca.
Selected discography[edit]
- The Cash Box Instrumental Hits, London LL158
- Plays for Latin Lovers, London LL248
- Jerome Kern's Symphonic Suite, London LL579
- Berlin Suite, London LL811
- Some Enchanted Evening, London LL1098
- Dancing in the Dark, London LL1099
- Carnival in the Sun, London LL1100 (1955)
- Festival in Costa Rica, London LL1101
- Music for Romance, London LL1149 (1955)
- Cuban Moonlight, London LL1166 (1956)
- Music of Richard Rodgers, London LL1209
- Plays for Latin Lovers, London LL1248
- The Night Was Made for Love, London LL1307
- Summer Evening Serenade, London LL1332
- The Music of Lecuona, London LL1438 (1958)
- Music of Cole Porter, London LL1565
- Red Velvet, London LL1592 (1956)
- Tropical Moonlight, London LL1615 (1957)
- Moonlight Cocktail, London LL1709 (Dec 1957)
- Place Pigalle, London LL1742 (1957)
- Sophisticate in Cuba, London LL 1781 (1958)
- The All Time Top Tangos, London PS 176 (1959)
- More Top Tangos, Decca SKL 4812
- Gershwin Goes Latin, London PS 206 (1960)
- Ravel - Bolero, London Phase 4 SPC 21003
- Rhapsody in Blue, London Phase 4 21009
- Spectacular Dances for Orchestra, London Phase 4 SP 21020
- Overture!, London Phase 4 21028
- Great Rhapsodies, London Phase 4 21030
- Exotic Percussion, London Phase 4 SP 44004 (1962)
- Spain, London Phase 4 SP 44016 (1963)
- Film Spectacular, London Phase 4 SP 44025
- Film Spectacular Vol.2, London Phase 4 SP 44031
- Music of a People, London Phase 4 SP 44060
- Broadway Spectacular, London Phase 4 SP 44071
- Russia, London Phase 4 SP 44075
- Film Spectacular Vol.3, London Phase 4 SP 44078
- Broadway Blockbusters, London Phase 4 44088
- Dimensions in Sound, London Phase 4 SP 44105 (1968)
- Fiddler on the Roof, London Phase 4 44121
- Film Spectacular Vol. 4, London Phase 4 44173
- Rhapsody in Blue, London Phase 4 21009
- Digital Spectacular!, London LDP 30001
- Film Spectacular Vol. 5, London Phase 4 SP 44225
- South of the Border, London: Richmond B 20003
- Melodies Of Love, London: Richmond B20004
- Music Of Jerome Kern and Irving Berlin, London: Richmond B20011
- Accent On Romance, London: Richmond B 20024
Selected filmography[edit]
- Dual Alibi (1947)
- It Always Rains on Sunday (1948)
- The Fatal Night (1948)
- Laughter in Paradise (1951)
- The Naked Truth (1957)
- Blood of the Vampire (1958)
- The Trollenberg Terror (1958)
- Further Up the Creek (1958)
- Too Many Crooks (1958)
- Make Mine a Million (1959)
- Jack the Ripper (1959)
- The Battle of the Sexes (1959)
- Hand in Hand (1960)
- The Flesh and the Fiends (1960)
- Hell Is a City (1960)
- Sands of the Desert (1960)
- The Siege of Sidney Street (1960)
- The Full Treatment (1960)
- The Long and the Short and the Tall (1961)
- House of Mystery (1961)
- Double Bunk (1961)
- The Day the Earth Caught Fire (1961)
- The Pot Carriers (1962)
- Maniac (1963)
- 80,000 Suspects (1963)
- West 11 (1963)
- The System (1964)
- Rattle of a Simple Man (1964)
- City Under the Sea (1965)
- Crossplot (1969)
- Valentino (1977)
References[edit]
- ^ abcdefghColin Larkin, ed. (1997). The Virgin Encyclopedia of Popular Music (Concise ed.). Virgin Books. pp. 142/3. ISBN1-85227-745-9.
- ^''Music of the People/ Spirit of the People' CD sleeve note cited at'. cduniverse.com/. Retrieved 6 October 2014.
- ^McDonald, Tim (3 December 2002). 'Stanley Black'. The Guardian. Retrieved 6 January 2020.
- ^ abc'Stanley Black'. The Daily Telegeraph. 28 November 2002. Retrieved 6 January 2020.
- ^'BBC Radio 4 Extra - Ray's a Laugh, From 11/10/49'. BBC. Retrieved 1 February 2021.
- ^McDonald, Tim (3 December 2002). 'Obituary: Stanley Black'. the Guardian. Retrieved 1 February 2021.
- ^Spencsr Leigh Obituary: Stanley Black, The Independent, 2 December 2002
- David Ades' biography at the Robert Farnon Society
External links[edit]
- Stanley Black at IMDb
- Stanley Black at AllMusic