Set audio in/output with shell command

Hi.
I want to switch the systems audio input and output with a shell command. I've found a command that can set the volume. Maybe someone can tell me if this is possible and if so, which command i need.
osascript -e "set Volume 0"

I think there's a messy way of doing it in AppleScript by addressing the menus in the System Preferences. But if I were you I would have a look at the tool that someone has created here:
http://code.google.com/p/switchaudio-osx/
It addresses CoreAudio directly I think to change the input/output method:
will@Newton:~/Downloads/SwitchAudioSource-v1> ./SwitchAudioSource
Please specify audio device.
Usage: ./SwitchAudioSource [-a] [-c] [-t type] -s device_name
-a : shows all devices
-c : shows current device
-t type : device type (input/output/system). Defaults to output.
-s device_name : sets the audio device to the given device by name
will@Newton:~/Downloads/SwitchAudioSource-v1> ./SwitchAudioSource -a
Built-in Microphone (input)
Built-in Input (input)
Built-in Output (output)
will@Newton:~/Downloads/SwitchAudioSource-v1> ./SwitchAudioSource -c
Built-in Output
will@Newton:~/Downloads/SwitchAudioSource-v1> ./SwitchAudioSource -t input -s 'Built-in Input'
input audio device set to "Built-in Input"

Similar Messages

  • Problem with shell commands and scripts from an Applescript Application

    Hi-
    I am fairly new to OSX software development. I am trying to build an application that creates a reverse SSH tunnel to my computer and starts OSXvnc. The idea is that my Mom or anyone else who needs help can connect to me without having to tinker with their firewalls.
    There are plenty of resources on how to do this, and I have found them. What I have a problem with is the following.
    I am building this application in Xcode as an Applescript application, because Applescript and shell scripting are the only forms of programming I know. I use an expect script to connect through SSH, and a "do shell script" for the raw OSXvnc-server application to allow screen sharing.
    The problem is that when I click on the button to launch OSXvnc-server or the button to launch SSH, the application freezes until the process it spawns is killed or finishes. For example, I can set SSH to timeout after 60 seconds of no connection, and then the Applescript application responds again. I even tried using the ssh -f command to fork the process, but that doesn't seem to help.
    I am also using "try" around each of the items.
    What am I doing wrong? How can I make the buttons in my app launch SSH and OSXvnc-server without hanging the application while it waits for them to finish?
    Thanks so much!

    See here for an explanation of the syntax.
    (20960)

  • HT201412 Siri has disappeared from my husbands iphone 4 however my iphone 5 & ipad air both have siri setting and she works with voice commands How do i reinstall Siri on my husbands iphone 4 settings ect?my two are fine so can remote settings be sent to

    siri works fine on two apple products but is dissapeard from my husbands older iphone 4 It ie nit in the settings and holding the hone button leasds to voice command, Help Language is correct i checked restriction ans codes so can someone just resend the setting to me?7067285323 Please help it bothers us

    The iPhone 4 does not support Siri.
    iPhone 4S or later
    iPad 3rd generation or later
    iPad mini
    iPod touch (5th generation)
    From here > iOS: About Siri

  • Using subprocess in python3 to get output of a command

    Hi Friends. I am writing a python3 script for audacious to check the internet for album cover of the current playing song and then display it in conky. I am trying to call a command from python and get it's output:
    audtool current-song-tuple-data album
    but when i use this command in python like this:
    subprocess.check_output(["audtool", "current-song-tuple-data album"])
    i get the following error:
    Unknown command "current-song-tuple-data album".  Try "audtool help".
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.2/subprocess.py", line 522, in check_output
        raise CalledProcessError(retcode, cmd, output=output)
    subprocess.CalledProcessError: Command '['audtool', 'current-song-tuple-data album']' returned non-zero exit status 1
    Please , python experts on this forum, help me.

    @Pranavg1890: Please add solved to your thread title then.
    BTW: I found pexpect a good option for interacting with shell commands:
    http://sourceforge.net/projects/pexpect/
    It provides an easy way to deal with console output and react on certain patterns.

  • Shell command authorization

    Hi all
    I am having a problem with Shell Command Authorization. I have a user setup who I only want to be able to display the config, this is for automated config archival on an hourly basis.
    I have configuered the device with the following aaa commands:
    aaa new-model
    aaa group server tacacs+ ACS
    aaa authentication login default group ACS
    aaa authentication login NOAUTH none
    aaa authorization config-commands
    aaa authorization exec default group tacacs+ group ACS
    aaa authorization exec NOAUTH none
    aaa authorization commands 15 default group ACS
    aaa authorization commands 15 NOAUTH none
    aaa accounting commands 15 default start-stop group ACS
    The static account I have configured logs in ok and can show config etc. Access to conf t is disabled which is good but for some reason he can do any show command instead of just show run which is all I have allowed in the Shell command authorization.
    Unmatched commands is set to deny and permit unmatched arguements is unchecked.
    ACS is 3.3(2) and the switch I am testing is running 12.1(9)EA1
    Any ideas?

    Most "show" command are level 1 commands. You can verify this by logging in as a normal user, issue a "sho priv" to ensure you're at level 1, and then type "sho ip route", "sho ver", etc, you'll see that all of them work fine.
    Your AAA commands only tell the switch to authorize level 15 commands, so when you do a "sho ver" or the like this command will not be sent off to the ACS server for authorization.
    If you add the following:
    aaa authorization commands 1 default group ACS
    then that shoud fix it, but be careful because it's easy to lock yourself out of being able to get into enable mode (add "enable" into your command set too).
    You should also have noticed that all those "show" commands weren't being accounted either, because you have also only enabled accounting for level 15 commands.

  • AAA with CatOS and ACS (shell command autorization set)

    Hi,
    I have an ACS that authenticates and authorizes IOS devices.
    I use "shell command autorization set" to authorize some commands for some groups.
    Is it possible to do so with CatOS?
    For example, I'd like that the groupe FULL can access all command and the group LOW can onmy access "sho" commands?
    Regards,
    ROMS

    Console> (enable) set tacacs server [IP] [primary]
    set tacacs key [key]
    set tacacs attempts [number] (optional)
    set localuser user [user] password [password] privilege 15
    set authentication login local enable
    set authentication login tacacs enable [all | console | http | telnet] [primary]
    set authorization exec enable tacacs+ [deny | none] [console | telnet | both]
    set authorization commands enable [config | all] tacacs+ [deny | none] [console |telnet | both]
    regards,
    ~JG

  • Cisco Secure ACS 4.2 - Group Setup w/Shell Command Authorization Sets

    Hello All,
    I am trying to create a user so that I can provide him only to run commands that I have designated them to run within my "Shell Command Authorization Set". This seems to work great, however I cannot find anywhere I can "hide" commands they do not have access to. For instance, once the user is logged into the switch they can do a show ? and get a list of commands. I would like to know if there is an option to only display commands the user has access to in ACS.
    My Steps:
    Created a user in ACS
    Shared Profile Components
    Create Shell command Autorization Set - "ReadOnly"
    Unmatched Commands - Deny
    Unchecked - Permit Unmatched Arg
    Commands Added
    permit interface
    permit vlan
    permit snmp contact
    permit power inline
    permit version
    permit switch
    permit controllers utilization
    permit env all
    permit snmp location
    permit ip http server status
    permit logging
    Created a group - "GroupTest" with the following
    Confirgured - Network Access Restrictions (NAR)
    Max Sessions - Unlimited
    Enable Options - No Enable Privilege
    TACACS+ Settings
    Shell (exec)
    Priviledge level is check with 1 as the assigned level
    Shell Command Authorization Set
    "ReadOnly" - Assign a Shell Command Authorization Set for any network device
    I have configured following on my Router/Switch
    aaa authorization config-commands
    aaa authorization commands 1 default group tacacs+ if-authenticated
    privilege exec level 1 show log
    I have attached below the documention I have gone over.
    http://www.cisco.com/en/US/products/sw/secursw/ps2086/products_configuration_example09186a00808d9138.shtml
    http://www.cisco.com/en/US/docs/net_mgmt/cisco_secure_access_control_server_for_windows/4.2/user/guide/GrpMgt.html#wp478624

    "you are testing with privilege level 15 or below 15. Because when you are using below 15 level user, first it will check local command authorization set. For example if you want to execute sh runn command with level 5 user, first it will check local command set. If the sh runn command exits in local command set then it will send request to ACS. If it is not in the command set, it won't send request to ACS. That's why you don't see debug. For 15 level users it will directly send request to ACS. Configure command set locally and try it should work.
    Correct me if I am wrong."
    Regards
    Vamsi

  • Audio level output too low, even if set to maximum

    OS: Windows XP Professional Service Pack 3-Build Lab: 2600.xpsp_sp3_gdr.080814-1236
    Audio driver:  SoundMAX Integrated Digital HD Audio - Analog Devices - Driver date: 08/02/2008, Driver version: 5.10.1.5520
    The audio level output is too low, even if setting the output for all sources to the maximum level.
    Does somebody have the same problem?
    Need your help to see how to correct this and return to a normal operation!
    Thank you very much in advance for your help and answers.

    Additional informations: 
    Tested with the audio driver found at Lenovo's website, without any success.
    After this was done, the audio driver was updated also without success too.

  • ACS - Shell Command Authorization Sets

    Hi,
    I have had a problem where a set of users in two groups in ACS are struggling entering commands.  The commands are set in the Shell Command Authorization Sets and this hasnt changed.  Other commands are working.  As this is spanning two groups in ACS I am thinking it's not something with the groups but the command sets itself.
    Just to check, the commands are 'clear port-security' and clear mac address-table' - I have entered in Command 'clear' and the following attributes;
    permit port-security
    permit mac address-table'
    I've also ticked 'Permit unmatched args'
    At the same time as this is occuring I have been recieving the following messages from the ACS server via email;
    Test Timed out for service: CSAdmin
    Test Timed out for service: CSAuth
    Test Timed out for service: CSDbSync
    Test Timed out for service: CSLog
    I have looked at other posts and have restarted CSMon.  This then stops the messages for some time, then a day or so later I get the messages again.
    Could this be tied in with the command issue?  Is there something else I should look at other than restarting the server and the CSMon service again?  All other CS' services are running.
    Thanks!!
    Steve

    Thanks for your reply!
    there are no errors, the switch ios is putting the asterics as it does when you enter a command that is not recognised, i.e. for clear port-security the port-security onwards is not recognised.  On this note, the user is entered into priviledge mode and not in configure terminal mode, just base priviledge mode.  The group in ACS is set to max priviledge level 7 and have also set this on the user account in addition.
    I am using ACS v 4.1.
    While I receive the service messages and also when they go away - I always have the authorisation problem.
    Thanks
    Steve

  • How to append linux shell command output to MariaDB?

    That link gave me an idea, I can create an .sql template file with the "insert" query, dump the shell command output to a text file (>), then use "grep" and "sed" to append the desired parts of the command's output file to that .sql file and then execute the .sql file. What do you think?

    I haven't done this myself, but it is probably something along the lines of the answer provided in this link:
    http://stackoverflow.com/questions/3900496/using-shell-script-to-insert-data-into-remote-mysql-datab...
    

  • IS there an easy way to execute a shell command and capture its output...

    From an application? I am thinking of using fork and then waiting for the PID to finish and write the output to a file which I then read, but this seems clunky. Also there are big warnings about frameworks getting hosed if you use fork, although the "Forked" process will exec the shell command and the one that gets the PID the original process might be 'safe' from this framework corruption. I am not certain of this, it is just a guess.
    If there was something like a process class where I could specify the executable and parameters, and read from it's std out until the process completed, that would be better. Or even get a callback when the process exited and an asynchronous callback for each line of data it produced.

    That was just in response to OrangeKay implied accusation that I was some kind of hard-core Microsoft programmer that sneered at apple programmers.
    You may want to book mark this, I will go over a brief history which should clear a lot of things up, about me, and about what I am doing.
    Lets turn the clock back to 1998: I graduate from a university with a BS in Computer science. I had been interning at a local defense contractor writing missile testing software. This was on a proprietary hardware and so there was no "Microsoft" involved. At this point I think Bill Gates = Satan. Microsoft = Kingdom of Evil.
    I get a job as a video game programmer. I write code from the Playstation, then the Playstation 2 and Gamecube. I do this for several years and again I have zero interest / knowledge of the Microsoft world beyond it being the OS which I am forced to use to play my games on. I had fought this by trying to use OS Warp and other things, but eventually since I mainly had a PC for games I had to get a windows OS, the first being NT 3.51 and then Win98 cause NT4.0 didn't support past directx 3 and everyone was using directX 5 or 6 (I do not remember).
    As video game companies go, they do not last. Everyone wants to write video games, anyone with some cash wants to start a company. 1 in 1000 will make it 5 years. Needless to say, as our company began to tank, I got laid off, along with my entire team. I have cash in the bank, no big deal, right?
    Well the economy started to suck, video game developers were closing down like crazy so the market was saturated with x-video game developers. 2 Years go by, no job, and almost no money. Then I get a call from some guy who wants me to come for an interview about 75 miles away. It is in a place I do not want to go. So they interview me, and ask me a bunch of general programming questions.
    I leave the place, and by the time I get home there is a message on my machine asking me if I would take the job at a ridiculously high salary (I live in an area where the cost of living is very low). Well I am about out of money and its a job offer with a huge salary, so I take it.
    I get there and guess what? I get to work on this "agent" that runs on windows boxes. I have NO IDEA how to program on windows. Windows is evil, why would I want to taint myself with this vile Microsoft APIs? I really have no choice, I have to learn how to develop on windows. I get to use visual studio 6, which I do not understand because I used the Borland compilers (Borland != Microsoft).
    Well I start to slug through it all and get familiar with MSDN and CodeProject and CodeGuru. As the years pass, I begining applicate the examples and detailed documentation that MSDN has. I have a start page on MSDN which covers every category of operation which will take you through a tree of choices and lead you to the exact area related API calls you will need to use to do whatever you want. Now I do not think MS = Evil anymore. I switch to DevStudio 2005 which is really nice. The debugging, IDE, and everything is great.
    Now the other half of this application resides on a server. That server is a Linux box, and the server app is written in Java. My stuff is still C++.
    One day, I get a request, and a eMac with 10.4 PPC to make a Mac version. Now I am at the point of Mac programming as I was with Windows when I started. I didn't know anything about it. I was looking for CodeWarrior cause I used that in the past, but alas, CodeWarrior is no more. I get XCode. I see all sorts of options to make a project. BSD project, Carbon, Cocoa, etc... What the heck any of these. I can guess the BSD one is very basic, but I do not understand Carbon vs Cocoa.
    So what do I do? I make a basic carbon app and make a basic Cocoa app. The carbon app looks like some kind of C++ framework. The Cocoa app? "Is this another language like Java or C#? It doesn't look like a C++ language."
    Guess which choice I make. Carbon. I struggle through this looking at the docs, posting on CodeGuru and whatnot until someone finally tells me about these forums and warns me about how unfriendly people are. So I make an account and start asking questions. I eventually get my app to be multi-platform to run on windows and Mac by using some API abstractions which are easy to do since I had abstracted the Windows API by my own class wrappers.
    I ask a lot of questions, very few are ever answered because I am not asking about simple things, like making windows and how to get button clicks and that stuff. I am asking stuff like, "How do you change the DNS? or How do I know when a user is about to log out?" Currently on my side list as I type this, I have 27 unresolved questions. I probably found workaround for most of them, or figured it out eventually.
    On this forum mostly people are helpful when the do respond, except for OrangeKay. He definitely has a chip on his shoulder.
    Over the past few years my Opinion of MS has improved greatly while my opinion of Macs (from the programmer's point of view) has dropped considerably. XCode still isn't as good as VS6 which is like 15 years old, never mind Dev studio 2005 or 2008. The documentation is scattered, not easy to find, occasionally wrong, or simply missing. The examples may not even compile or contain non-existent functions. It is unbelievable how bad it is.
    If Steve Jobbs wants to really get a large coder population he ought to spend some of those billions (or is it trillions) of dollars on a team that will re-write the current documentation in a correct, easy to understand, with full examples, arranged in a logical manner for everyone to use. He should say, "See MSDN online? I want something like that, only better, it has to be MUCH better." Then he should say to the XCode team, "Look at DevStudio 2008. XCode should do EVERYTHING that does. Once that is done, IMPROVE XCode even more to make 2008 look like a joke."
    To bad the Developer aspect of the "Apple Experience" has not gotten "End User" treatment. Then it would be a joy to develop on Macs.
    So here I am asking for help on certain things. You wonder why I do not use Cocoa. Maybe I should, maybe I shouldn't. My first look didn't look promising, and a quick look at the docs is all about GUI's. My app has NO GUI. Again, Cocoa? Maybe it will still work, but the examples and stuff I see are all about GUIs.
    When I get time, I will look at cocoa even further. MFC on windows is MOSTLY about GUI stuff, but there is a small section of it that does not deal with GUIs. CString is a great MFC class. I had to get rid of it though cause Mac's do not have a similar class. I use CStdString which is a platform agnostic CString replacement.
    I hope you are all a little more enlightened. BTW my Application which runs on Mac's and PCs on no less then 3 MILLION Machines has not crashed ONCE in the past 2 years. There have been bugs, but nothing that crashed it. The bugs were mostly unforeseen situations, like what if the guy has 15 network adapters that are all LIVE? I didn't plan for that, there were complications, the server got some strange data, but it didn't crash (My app, not the server. It crashes on occasion still). Are there bugs in my code? I am sure there are, but I do not know of any, because if I did, it would be fixed.

  • ACS Shell Command Authorization Set + restricted Access

    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin-top:0in;
    mso-para-margin-right:0in;
    mso-para-margin-bottom:10.0pt;
    mso-para-margin-left:0in;
    line-height:115%;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;}
    Hi  ,
    I have tried to Create a restricted Access  Shell Command Authorization Set on  ACS as told on the Cisco Url
    http://www.cisco.com/en/US/products/sw/secursw/ps2086/products_configuration_example09186a00808d9138.shtml
    After I applied the same on a User  Group I found the users on the group have complete access after typing the conf  t  on the equipments . My ultimate aim was restrict the access only at Interface level , Attached is the config details . Could anyone has come across such scenario . Please check my config and   let me know any thing need to be done specially from My Side
    Thanks in Advance
    Regards
    Vineeth

    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin-top:0in;
    mso-para-margin-right:0in;
    mso-para-margin-bottom:10.0pt;
    mso-para-margin-left:0in;
    line-height:115%;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;}
    Hi Jatin ,
    first of all Thank you very much . It startted working after aaa authorization config-commands
    here I was trying to achive one  specfic  thing .
    I want to stop  the following commands  on ACS “switchport trunk allowed vlan 103” . I only want allow “add”  after “vlan” and block rest all arguments
    But even after setting the filter on ACS Still we are able to execute the command is there anything like we cannot control the commands after the sub commands
    Also I am attaching the filter list along with this. Could you have look on this and let me know whether I have configured something wrongly. Other than this is there any work around is available to achieve this .
    Thanks and Regards
    Vineeth

  • Shell Command Authorization Sets for device using NDGs??

    Hello. I NDGs configured, there is a group called "GR1" with 30 switch.
    This group is set up a Shell Command Authorization set called "Monitoring", in which only show commands, ping and traceroute are allowed.
    I want to let users switch in only 10 of the group "GR 1" to configure certain interfaces and IP addresses, switch to the other not. ! Note: The number of interface is not the same for each switch, one can be FA0 / 1, but for others it may fa0/3.etc.
    I want to retain these 10 switch within the group "GR1", it is possible to make this configuration?
    - Thanks

    I've edited my earlier post to make it more clear. You can assign Shell Auth. Sets at the user,group or NDG level.More details are mentioned on the following link:
    http://www.cisco.com/en/US/docs/net_mgmt/cisco_secure_access_control_server_for_windows/4.2/user/guide/SPC.html#wpmkr697610
    AFAIR, one device (AAA Client) can be part of only one NDG, so you cannot achieve your requirement by using per-NDG Shell Command Authorization sets. Unless you break up the NDG into more than one NDG.
    You can assign the authorization set at the user or group level (after putting the appropriate users in the group) to achive your requirement.
    You could also use the 'privilege' command on the switch to make sure that users can see only the commands you want. E.g. when a user logs in he will be placed at level 7. Now you can keep the undesired commands at level 15 and bring down the desired commands at level 7. All other users would be assigned a lower level (e.g level 5), so they wont be able to run these commands.
    Regards
    Farrukh

  • ACS 5.x using of per-user Shell Command Authorisation with NDGs

    We have an implemented of ACS 4.x which allows customers access to their own devices (defined in distinct NDGs). The NDGs are referenced in the "Shell Command Authorization Set" component of "TACACS+ Settings" under the "Assign a Shell Command Authorization Set on a per Network Device Group Basis". How would this map onto ACS 5.x rule-based functionality; would an authorization rule be require for each user?
    Thanks,
    Matt

    Hi Matt
    In ACS 5 you would create an authorization rule for each user or identity group. You could then add conditions to each policy to allow them access to specific devices. You would then add an authorization rule to each policy with your specific shell commands added to it.
    If your authorization policies are a mixture of internal users and AD users then you would need to use a identity store sequence for each policy, rather than specifically choosing internal user or AD user. This is something I found out recently.
    So the process would be
    create an access service for tacacs
    then create a service selection policy to match the tacacs protocol and maybe a specific device type such as cisco router.
    then configure your identity within the access service
    then configure your authorization policies within the access service
    I'm no expert on the new ACS and I'm not 100% I'm doing it the correct way but I have done lots of testing and things are working as I want them too. I can allocate admin and or read only access to users based on their AD group.
    You need to set up your NDG in a way you can be as granular as possible within your policies.
    Cheers
    Jay

  • ACS 4.0, only 1 Shell Command auth. set possible

    Hi all,
    I am wondering if this is a "hidden feature" of the evaluation software or a bug...
    I am currently running Cisco Acs server v.4.0 (evaluatie version) Win2k3 platform; with authentication, authorization and accouting.
    In a nutshell I have the following setup:
    - group1 uses: Shell Command Authorization Set1
    - group2 uses: Shell Command Authorization Set2
    Problem: Users in group2 are somehow authorized against the commands listed in Shell Auth. Comm. set1 instead of the configured Shell Auth. Comm. set2
    Is it possible that with the evaluation software only one Shell Command Authorization Set is allowed to be active? Does anyone know?
    Many thx
    Sander

    Problem resolved by renaming authorization sets and reloading ACS......
    thx Sander

Maybe you are looking for