Search Results

Search found 31774 results on 1271 pages for 'chris go'.

Page 13/1271 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • How to configure Apache so all requests go to single CGI file

    - by fastmonkeywheels
    I'm porting a CGI application from an embedded web server to run under Apache. In the effort of changing the least amount required I'm trying to figure out how to configure Apache so any requests coming in go to my CGI program, which then will use the QueryString environmental variable to determine which file needs to be created. I have Apache working now to where it will process my CGI file if it's requested directly i.e. localhost/cgi-bin/cgi_test.out but I need to figure out how to get my application to be called whenever any file is requested: localhost/ - call my application with QueryString set to "" or "/" localhost/thisFile - call my application with QueryString set to "/thisFile" etc. I have been doing all of my configuration testing under /etc/apache2/sites-available/mysite, which has been enabled and the default disabled. Thanks for any help. I've tried the recommendation from here: http://serverfault.com/questions/56082/configure-apache-to-handle-all-requests-via-single-index-php but I keep getting circular redirects.

    Read the article

  • dhcpd won't let go of old leases

    - by Jakobud
    We have DHCP setup to hand out leases in the following range: 192.168.10.190 - 192.168.10.254 (roughly 65 leases) Our small business network only has about 30 computers that use DHCP. We noticed that dhcpd stopped handing out new dynamic leases to the computers, even though there are definitely not 65 computers on the network. Why has it stopped handing out leases? Is it not releasing old un-used leases? How do we tell dhcpd to let go of old leases and start handing out fresh ones again?

    Read the article

  • Wi-Fi connected but can't go to any site

    - by Michael Dy
    My Windows 7 laptop can connect to our Wi-Fi signal, I can sign in on Yahoo! Messenger, but I can't go to any site. I can access the Net on other devices. The issue started a few weeks ago, so I've been troubleshooting since then in vain. There's no virus, and I already used System Restore. In Wireless Network Connection Status, the received activity is greater than the sent activity. I turned off Windows Firewall and still no Net access. My ping tests: How do I fix this?

    Read the article

  • Where does power consumption go in a computer?

    - by Johannes Rössel
    Today we had a weird discussion over lunch: What exactly causes power consumption in a computer, particularly in the CPU? Figures you usually see indicate that only a percentage (albeit a large one) of the power consumption ends up in heat. However, what exactly does happen with the rest? A CPU isn't (anymore) a device that mechanically moves parts, emits light or uses other ways of transforming energy. Conservation of energy dictates that all energy going in has to go out somewhere and for something like a CPU I seriously can't imagine that output being anything but heat. Us being computer science instead of electrical engineering students certainly didn't help in accurately answering the question.

    Read the article

  • Where should custom vmware-tools scripts go

    - by Cylindric
    I have installed the VMWare Tools into a test Ubuntu guest, and it's created the standard scripts as expected: poweroff-vm-default poweron-vm-default resume-vm-default suspend-vm-default I add some custom actions to the scripts, but it says in the top of the file ########################################################################## # DO NOT modify this file directly as it will be overwritten the next # time the VMware Tools are installed. ########################################################################## So where should the custom scripts go, if I'm not supposed to modify these ones? scriptsdir="`dirname $0`/scripts/`basename $0`.d" if [ -d "$scriptsdir" ]; then for scriptfile in "$scriptsdir"/*; do [ -x "$scriptfile" ] && "$scriptfile" poweron-vm done fi

    Read the article

  • How to write a ProxyPass rule to go from HTTPS to HTTP in IIRF

    - by Keith Nicholas
    I have a server which is running a web app that self serves HTTP. I'm wanting to use IIS6 (on the same server) to provide a HTTPS layer to this web app. From what I can tell doing a reverse proxy will allow me to do this. IIRF seems like the tool to do this job. There are no domain names involved.... its all ip numbers. So I think I want :- https:<ipnumber>:5001 to send all its requests to the same server but on a different port and use HTTP ( not exposed to the net ) http:<ipnumber>:5000 but not sure how to go about it with IIRF, I'm not entirely sure how to write the rules? I think I need to make a virtual web app on 5001 using HTTPS? then add a rules file.

    Read the article

  • Go back to 32-bit Java in OS X so I can use Chrome

    - by Mac Kris
    Recently Apple released a Java update. I mindlessly downloaded and installed it, thinking it must be good (I know that was stupid on my part). Now chrome doesn't work where sites require Java support. In terminal, java -version shows I have the 64bit version installed. I know Chrome does not support 64bit Java. I'd like to go back to the last version that worked for me, the 32-bit version. I don't want to use Safari or Firefox. I'd like Chrome to work. I have too much invested in customizing it to work with another browser.

    Read the article

  • JAVA vs .NET Technology - Way 2 go Futher

    - by Sarang
    I have my subject .net acedemically. I also learned core-java and did a project as well. I took training from a java firm. Now, as a skill I do have knowledge as both language. But, it is creating a large problem to me that, which field I should chhose? Even if having better OOP funda, will it be easier for me to transfer from one-another in future ? Please suggest me a way. Also, we do have may technologies available at both side, like JSP, JSF, J2ME, Share Point, SilverLight etc. Which is better as per their reliabity point of view? Which are fast growing and useful technologies used mostly in current IT corporate world ? Are they easier to learn at fresher's point of view? Please answer. Perhaps, this answer may help me mostly to create my way to learn them and go further.

    Read the article

  • After installing Office365 can you go back to Office 2008 (without the CD)

    - by Ryan
    I got this laptop from my dad and don't have the Microsoft Office 2008 CD which is what he had installed when he gave it to me to use. Now I've got a client that wants me to do some freelance work and sent me to Microsoft Exchange and the first thing it wants me to do in the Exchange is install Office365. The client mentioned very briefly that he would get me the software if necessary but he wasn't specific about what software. Now that I see it my concern is after the job is done I'll be left with a monthly bill to have Office. Will it be possible to go back to Office 2008 without having the CD?

    Read the article

  • My computer won't go into standby or hibernate

    - by Thomas B.
    Hi. I have a problem that I first noticed yesterday. Whenever I would press the half moon standby button on my keyboard, my computer would go to sleep. I also have a shortcut on my desktop configured to put my computer into hibernate. But now whenever I try to put my pc in sleep or hibernate mode, my monitor goes black for a few seconds but then comes back on at the login screen. I haven't installed or changed anything other than create a couple logical partitions in the hfs+ filesystem. (still in the process of trying to triple-boot) Any help would be great, but for now I'm going to bed. Will check back in the morning.

    Read the article

  • Tcp window size won't go above 130048

    - by Roger
    I have 2 servers set up with about 80ms latency between them. Both are centos 6 and run a java app that transfers data from on location to another. Both are on 1gbps connections. I have been trying different sysctl settings and different send & receive buffer settings in java but no matter what I set them to, I cannot get the tcp window size to go above 130048 in the tcp dumps. This equates to roughly 13mbps which is the actual throughput I am getting.

    Read the article

  • Windows 8.1 will not go back to sleep after waking up

    - by per
    I have problems putting Windows to sleep and starting the screen saver on my new Windows 8.1 machine. Sleep mode and screen savers work only when the computer is first powered up (or restarted). But once it goes to sleep (manually or automatically) and I wake it up later, it wont go back to sleep again and I can't use screen savers either. I updated the chipset and graphics card drivers. My computer isn't part of a homegroup either. Does anyone else have similar issues? Thanks for your advice, per

    Read the article

  • Make user uploads go to different hard drive?

    - by Andrew Fashion
    I am using a pre-made social networking script where all user uploads go to site.com/public/user/ How can I make /public/user/ my secondary hard drive so all user uploads are uploaded to my second harddrive and not the primary hard drive. I have over 100GB of images, and I want them on my other HDD now. Thank you. I am running CentOS 5.5 64bit w/ Apache and PHP I have two 250GB Sata HDDs sudo parted /dev/sda print Model: ATA WDC WD2500KS-00M (scsi) Disk /dev/sda: 250GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 107MB 107MB primary ext3 boot 2 107MB 8595MB 8488MB primary linux-swap 3 8595MB 10.7GB 2147MB primary ext3 4 10.7GB 250GB 239GB extended 5 10.7GB 250GB 239GB logical ext3 Information: Don't forget to update /etc/fstab, if necessary. 5 10.7GB 250GB 239GB logical ext3

    Read the article

  • Windows 7 64 bit will hesitate and the screen will go black

    - by jondrnek
    I am running windows 7 64 bit with 2 monitors. Several time a day the system will freeze up for about 5 seconds and the screens will go black. After the 5 seconds are up, the system continues to function properly. I get no error messages that pop up and all the applications I am running handle it fine. All the devices appear fine, my drivers are up to date and nothing is jumping out at me in event viewer. What are the next troubleshooting steps I can take?

    Read the article

  • Cannot convert []string to []interface {}

    - by karlrh
    I'm writing some code, and I need it to catch the arguments and pass them through fmt.Println (I want its default behaviour, to write arguments separated by spaces and followed by a newline). However it takes []interface {} but flag.Args() returns a []string. Here's the code example package main import ( "fmt" "flag" ) func main() { flag.Parse() fmt.Println(flag.Args()...) } This returns the following error: ./example.go:10: cannot use args (type []string) as type []interface {} in function argument Is this a bug? Shouldn't fmt.Println take any array? By the way, I've also tried to do this: var args = []interface{}(flag.Args()) but I get the following error: cannot convert flag.Args() (type []string) to type []interface {} Is there a "Go" way to workaround this?

    Read the article

  • Gameplay : le toucher et le support des 2 en 1 pour vos jeux favoris, par Erik Niewmeyer et Chris Kirkpatrick

    Bonjour,Je vous présente cet article intitulé : "Gameplay : le toucher et le support des 2 en 1 pour vos jeux favoris" GestureWorks Gameplay est une nouvelle façon révolutionnaire pour interagir avec les jeux PC populaires. Le logiciel Gameplay pour Windows 8 permet aux joueurs d'utiliser et de créer leurs propres contrôleurs virtuels pour le toucher, qui recouvreront les jeux PC existants. N'hésitez

    Read the article

  • Laptop sleep: How to go into S3 easily?

    - by monov
    Laptop: Fujitsu-Siemens Amilo Pi-3525 OS: Vista When my laptop is plugged in and I close the lid, it goes into S1 sleep. This means that there is still: fan noise (annoying when trying to sleep at night) lots of power consumed (so if I then unplug the laptop and toss it in the bag, by the time I'm at school it's already drained and beeping ominously). What I want is S3 sleep, it solves both problems. I've found a roundabout way to go into S3 sleep: Unplug laptop Close lid (or click Sleep in Start menu) Plug laptop back in if needed The question: How do I force Windows to use always use S3 sleep when I close the lid? One thing I've tried is: dumppo admin minsleep=s3 (dumppo from here) Afterwards running just dumppo admin confirms that minsleep has been set, but closing the lid still goes into S1. Also, after a reboot, minsleep is reset to s1. I think dumppo is incompatible with Vista... MCE Standby Tool was recommended as a Vista-compatible alternative to dumppo, but it doesn't have any effect either. I looked in the BIOS settings, but there are no settings relating to ACPI sleeps/suspends there.

    Read the article

  • Mac and L2TP VPN no problems, xp, vista and 7 no go :s

    - by The_cobra666
    Hi all, I've got some weird problem and I'm out off options. The situation: When connecting from my mac to the VPN server (Windows Server 2003 R2) with L2TP PSK, everything works like it should. However, when I connect from a Windows PC, nothing happens. it spits out error 809 and sometimes 789. Now I know that my ports are OK, since the mac can connect without any problems. It's the same for: XP, Vista SP2 and 7. None can connect. If I connect to the VPN server directly (to the internal IP instead of WAN from the router), it connect's without a problem. Connecting using PPTP works... now if only L2TP would work thank you very much Windows! I have checked the counters on my linux router with iptables -L -nv and they do not raise when connecting. Not on ACCEPT and not on DROP. Only when connecting from the mac. I've found the guide from Microsoft to enable: AssumeUDPEncapsulationContextOnSendRule in the registery. I have set it to "2", on the server and client. Still no go. After that registery key it started giving me error 789 instead of 809. The IPSEC services are running on the client and server. Is there anyone that ppleease can help me with this! I've been working on this for 2 days and I'm out of options. Thanks!

    Read the article

  • how to go about scaling a web-application ?

    - by phoenix24
    for someone whoes been primarily a web-application developer, and know not much about scaling/scalability techniques. I'll start by stating my application is written in Python, using Django; a fairly standard setup. I currently use Apache 2.2 for my webserver, and MySql for my database server; both running on the same vps server. Up until now, it was basically a prototype and merely 15-30 concurrent users at any given time; so I had no issues, but now since we'll be adding more users we'll have severe performance issues. So my question is how do i go about scaling my web-application? and my plan is as follows. Now I have just one vps server running, apache + mysql. Next, I plan to add another vps server, to run only MySql; so i'll have one web-server and one db server. Next, I'll add Memcache to the webserver for caching data; and taking some load off mysql. Next, another web-server for serving all the static content; Next, a vps server for load-balancing (nginx/varnish) behind which would be my two web-servers and then db-server. Does that sound like a workable strategy, please guide me around here.

    Read the article

  • VLAN ACLs and when to go Layer 3

    - by wuckachucka
    I want to: a) segment several departments into VLANs with the hopes of restricting access between them completely (Sales never needs to talk to Support's workstations or printers and vice-versa) or b) certain IP addresses and TCP/UDP ports across VLANS -- i.e. permitting the Sales VLAN to access the CRM Web Server in the Server VLAN on port 443 only. Port-wise, I'll need a 48-port switch and another 24-port switch to go with the two existing 24-port Layer 2 switches (Linksys); I'm looking at going with D-Links or HP Procurves as Cisco is out of our price range. Question #1: From what I understand (and please correct me if I'm wrong), if the Servers (VLAN10) and Sales (VLAN20) are all on the same 48-port switch (or two stacked 24-port switches), afaik, the switch "knows" what VLANs and ports each device belongs to and will switch packets between them; I can also apply ACLs to restrict access between VLANs at this point. Is this correct? Question #2: Now lets say that Support (VLAN30) is on a different switch (one of the Linksys) switches. I'm assuming I'll need to trunk (tag) switch #2's VLANs across to switch #1, so switch #1 sees switch #2's VLAN30 (and vice-versa). Once Switch #1 can "see" VLAN30, I'm assuming I can then apply ACLs as stated in Question #1. Is this correct? Question #3: Once Switch #1 can see all the VLANs, can I achieve the seemingly "Layer 3" ACL filtering of restricting access to Server VLAN on only certain TCP/UDP ports and IP addresses (say, only permitting 3389 to the Terminal Server, 192.168.10.4/32). I say "seemingly" because some of the Layer 2 switches mention the ability to restrict ports and IP addresses through the ACLs; I (perhaps mistakenly) thought that in order to have Layer 3 ACLs (packet filtering), I'd need to have at least one Layer 3 switch acting as a core router. If my assumptions are incorrect, at which point do you need a Layer 3 switch for inter-VLAN routing vs. inter-VLAN switching? Is it generally only when you need that higher-level packet filtering ability between your departments?

    Read the article

  • Skip new Windows 7 user selection and go to login prompt

    - by Doltknuckle
    We've begun our migration to windows 7 and we ran into an interesting issue. When we hit "CTRL+ALT+DEL" we are brought to the "User selection Screen". Normally, this screen will have an icon for every local user for the machine. These machines are Domain members with "Fast User Switch" disabled so no user names are listed only the "Other User" option. If you click "Other User" or hit enter, the system moves on to the normal login screen where it prompts for user name and password. Here's the issue: We want to find a way to skip over the part where a user selects "Other User". We essentially want the system to always assume that we always want "Other User" and to go directly to the login screen when a user hits "CTRL+ALT+DEL". What I find odd is that the "Other User" doesn't show up until we've had more than one domain user log in. Right after we re-image the machine, the login process goes directly to the user credential prompt. Anyone have any ideas?

    Read the article

  • Continue with Java for pc or go to android? [on hold]

    - by Chris London
    so I have been learning java from Deitel's learn java 9th edition. I am up to GUI's and a have a pretty good grasp on OOP etc. I want to go straight to the mobile app development scene, I believe I will learn a fair bit there on using API's, and other tools to develop apps. I am not sure weather I should carry on with PC coding (GUI's etc etc) or skip it all and go direct to learning the Android SDK. So, should I carry on, learn about sockets, writing and reading files, GUI's for PC etc or get a book and jump into android? Thanks a lot guys.

    Read the article

  • SQL SERVER – Securing TRUNCATE Permissions in SQL Server

    - by pinaldave
    Download the Script of this article from here. On December 11, 2010, Vinod Kumar, a Databases & BI technology evangelist from Microsoft Corporation, graced Ahmedabad by spending some time with the Community during the Community Tech Days (CTD) event. As he was running through a few demos, Vinod asked the audience one of the most fundamental and common interview questions – “What is the difference between a DELETE and TRUNCATE?“ Ahmedabad SQL Server User Group Expert Nakul Vachhrajani has come up with excellent solutions of the same. I must congratulate Nakul for this excellent solution and as a encouragement to User Group member, I am publishing the same article over here. Nakul Vachhrajani is a Software Specialist and systems development professional with Patni Computer Systems Limited. He has functional experience spanning legacy code deprecation, system design, documentation, development, implementation, testing, maintenance and support of complex systems, providing business intelligence solutions, database administration, performance tuning, optimization, product management, release engineering, process definition and implementation. He has comprehensive grasp on Database Administration, Development and Implementation with MS SQL Server and C, C++, Visual C++/C#. He has about 6 years of total experience in information technology. Nakul is an member of the Ahmedabad and Gandhinagar SQL Server User Groups, and actively contributes to the community by actively participating in multiple forums and websites like SQLAuthority.com, BeyondRelational.com, SQLServerCentral.com and many others. Please note: The opinions expressed herein are Nakul own personal opinions and do not represent his employer’s view in anyway. All data from everywhere here on Earth go through a series of  four distinct operations, identified by the words: CREATE, READ, UPDATE and DELETE, or simply, CRUD. Putting in Microsoft SQL Server terms, is the process goes like this: INSERT, SELECT, UPDATE and DELETE/TRUNCATE. Quite a few interesting responses were received and evaluated live during the session. To summarize them, the most important similarity that came out was that both DELETE and TRUNCATE participate in transactions. The major differences (not all) that came out of the exercise were: DELETE: DELETE supports a WHERE clause DELETE removes rows from a table, row-by-row Because DELETE moves row-by-row, it acquires a row-level lock Depending upon the recovery model of the database, DELETE is a fully-logged operation. Because DELETE moves row-by-row, it can fire off triggers TRUNCATE: TRUNCATE does not support a WHERE clause TRUNCATE works by directly removing the individual data pages of a table TRUNCATE directly occupies a table-level lock. (Because a lock is acquired, and because TRUNCATE can also participate in a transaction, it has to be a logged operation) TRUNCATE is, therefore, a minimally-logged operation; again, this depends upon the recovery model of the database Triggers are not fired when TRUNCATE is used (because individual row deletions are not logged) Finally, Vinod popped the big homework question that must be critically analyzed: “We know that we can restrict a DELETE operation to a particular user, but how can we restrict the TRUNCATE operation to a particular user?” After returning home and having a nice cup of coffee, I noticed that my gray cells immediately started to work. Below was the result of my research. As what is always said, the devil is in the details. Upon looking at the Permissions section for the TRUNCATE statement in Books On Line, the following jumps right out: “The minimum permission required is ALTER on table_name. TRUNCATE TABLE permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and are not transferable. However, you can incorporate the TRUNCATE TABLE statement within a module, such as a stored procedure, and grant appropriate permissions to the module using the EXECUTE AS clause.“ Now, what does this mean? Unlike DELETE, one cannot directly assign permissions to a user/set of users allowing or revoking TRUNCATE rights. However, there is a way to circumvent this. It is important to recall that in Microsoft SQL Server, database engine security surrounds the concept of a “securable”, which is any object like a table, stored procedure, trigger, etc. Rights are assigned to a principal on a securable. Refer to the image below (taken from the SQL Server Books On Line). urable”, which is any object like a table, stored procedure, trigger, etc. Rights are assigned to a principal on a securable. Refer to the image below (taken from the SQL Server Books On Line). SETTING UP THE ENVIRONMENT – (01A_Truncate Table Permissions.sql) Script Provided at the end of the article. By the end of this demo, one will be able to do all the CRUD operations, except the TRUNCATE, and the other will only be able to execute the TRUNCATE. All you will need for this test is any edition of SQL Server 2008. (With minor changes, these scripts can be made to work with SQL 2005.) We begin by creating the following: 1.       A test database 2.        Two database roles: associated logins and users 3.       Switch over to the test database and create a test table. Then, add some data into it. I am using row constructors, which is new to SQL 2008. Creating the modules that will be used to enforce permissions 1.       We have already created one of the modules that we will be assigning permissions to. That module is the table: TruncatePermissionsTest 2.       We will now create two stored procedures; one is for the DELETE operation and the other for the TRUNCATE operation. Please note that for all practical purposes, the end result is the same – all data from the table TruncatePermissionsTest is removed Assigning the permissions Now comes the most important part of the demonstration – assigning permissions. A permissions matrix can be worked out as under: To apply the security rights, we use the GRANT and DENY clauses, as under: That’s it! We are now ready for our big test! THE TEST (01B_Truncate Table Test Queries.sql) Script Provided at the end of the article. I will now need two separate SSMS connections, one with the login AllowedTruncate and the other with the login RestrictedTruncate. Running the test is simple; all that’s required is to run through the script – 01B_Truncate Table Test Queries.sql. What I will demonstrate here via screen-shots is the behavior of SQL Server when logged in as the AllowedTruncate user. There are a few other combinations than what are highlighted here. I will leave the reader the right to explore the behavior of the RestrictedTruncate user and these additional scenarios, as a form of self-study. 1.       Testing SELECT permissions 2.       Testing TRUNCATE permissions (Remember, “deny by default”?) 3.       Trying to circumvent security by trying to TRUNCATE the table using the stored procedure Hence, we have now proved that a user can indeed be assigned permissions to specifically assign TRUNCATE permissions. I also hope that the above has sparked curiosity towards putting some security around the probably “destructive” operations of DELETE and TRUNCATE. I would like to wish each and every one of the readers a very happy and secure time with Microsoft SQL Server. (Please find the scripts – 01A_Truncate Table Permissions.sql and 01B_Truncate Table Test Queries.sql that have been used in this demonstration. Please note that these scripts contain purely test-level code only. These scripts must not, at any cost, be used in the reader’s production environments). 01A_Truncate Table Permissions.sql /* ***************************************************************************************************************** Developed By          : Nakul Vachhrajani Functionality         : This demo is focused on how to allow only TRUNCATE permissions to a particular user How to Use            : 1. Run through, step-by-step through the sequence till Step 08 to create a test database 2. Switch over to the "Truncate Table Test Queries.sql" and execute it step-by-step in two different SSMS windows, one where you have logged in as 'RestrictedTruncate', and the other as 'AllowedTruncate' 3. Come back to "Truncate Table Permissions.sql" 4. Execute Step 10 to cleanup! Modifications         : December 13, 2010 - NAV - Updated to add a security matrix and improve code readability when applying security December 12, 2010 - NAV - Created ***************************************************************************************************************** */ -- Step 01: Create a new test database CREATE DATABASE TruncateTestDB GO USE TruncateTestDB GO -- Step 02: Add roles and users to demonstrate the security of the Truncate operation -- 2a. Create the new roles CREATE ROLE AllowedTruncateRole; GO CREATE ROLE RestrictedTruncateRole; GO -- 2b. Create new logins CREATE LOGIN AllowedTruncate WITH PASSWORD = 'truncate@2010', CHECK_POLICY = ON GO CREATE LOGIN RestrictedTruncate WITH PASSWORD = 'truncate@2010', CHECK_POLICY = ON GO -- 2c. Create new Users using the roles and logins created aboave CREATE USER TruncateUser FOR LOGIN AllowedTruncate WITH DEFAULT_SCHEMA = dbo GO CREATE USER NoTruncateUser FOR LOGIN RestrictedTruncate WITH DEFAULT_SCHEMA = dbo GO -- 2d. Add the newly created login to the newly created role sp_addrolemember 'AllowedTruncateRole','TruncateUser' GO sp_addrolemember 'RestrictedTruncateRole','NoTruncateUser' GO -- Step 03: Change over to the test database USE TruncateTestDB GO -- Step 04: Create a test table within the test databse CREATE TABLE TruncatePermissionsTest (Id INT IDENTITY(1,1), Name NVARCHAR(50)) GO -- Step 05: Populate the required data INSERT INTO TruncatePermissionsTest VALUES (N'Delhi'), (N'Mumbai'), (N'Ahmedabad') GO -- Step 06: Encapsulate the DELETE within another module CREATE PROCEDURE proc_DeleteMyTable WITH EXECUTE AS SELF AS DELETE FROM TruncateTestDB..TruncatePermissionsTest GO -- Step 07: Encapsulate the TRUNCATE within another module CREATE PROCEDURE proc_TruncateMyTable WITH EXECUTE AS SELF AS TRUNCATE TABLE TruncateTestDB..TruncatePermissionsTest GO -- Step 08: Apply Security /* *****************************SECURITY MATRIX*************************************** =================================================================================== Object                   | Permissions |                 Login |             | AllowedTruncate   |   RestrictedTruncate |             |User:NoTruncateUser|   User:TruncateUser =================================================================================== TruncatePermissionsTest  | SELECT,     |      GRANT        |      (Default) | INSERT,     |                   | | UPDATE,     |                   | | DELETE      |                   | -------------------------+-------------+-------------------+----------------------- TruncatePermissionsTest  | ALTER       |      DENY         |      (Default) -------------------------+-------------+----*/----------------+----------------------- proc_DeleteMyTable | EXECUTE | GRANT | DENY -------------------------+-------------+-------------------+----------------------- proc_TruncateMyTable | EXECUTE | DENY | GRANT -------------------------+-------------+-------------------+----------------------- *****************************SECURITY MATRIX*************************************** */ /* Table: TruncatePermissionsTest*/ GRANT SELECT, INSERT, UPDATE, DELETE ON TruncateTestDB..TruncatePermissionsTest TO NoTruncateUser GO DENY ALTER ON TruncateTestDB..TruncatePermissionsTest TO NoTruncateUser GO /* Procedure: proc_DeleteMyTable*/ GRANT EXECUTE ON TruncateTestDB..proc_DeleteMyTable TO NoTruncateUser GO DENY EXECUTE ON TruncateTestDB..proc_DeleteMyTable TO TruncateUser GO /* Procedure: proc_TruncateMyTable*/ DENY EXECUTE ON TruncateTestDB..proc_TruncateMyTable TO NoTruncateUser GO GRANT EXECUTE ON TruncateTestDB..proc_TruncateMyTable TO TruncateUser GO -- Step 09: Test --Switch over to the "Truncate Table Test Queries.sql" and execute it step-by-step in two different SSMS windows: --    1. one where you have logged in as 'RestrictedTruncate', and --    2. the other as 'AllowedTruncate' -- Step 10: Cleanup sp_droprolemember 'AllowedTruncateRole','TruncateUser' GO sp_droprolemember 'RestrictedTruncateRole','NoTruncateUser' GO DROP USER TruncateUser GO DROP USER NoTruncateUser GO DROP LOGIN AllowedTruncate GO DROP LOGIN RestrictedTruncate GO DROP ROLE AllowedTruncateRole GO DROP ROLE RestrictedTruncateRole GO USE MASTER GO DROP DATABASE TruncateTestDB GO 01B_Truncate Table Test Queries.sql /* ***************************************************************************************************************** Developed By          : Nakul Vachhrajani Functionality         : This demo is focused on how to allow only TRUNCATE permissions to a particular user How to Use            : 1. Switch over to this from "Truncate Table Permissions.sql", Step #09 2. Execute this step-by-step in two different SSMS windows a. One where you have logged in as 'RestrictedTruncate', and b. The other as 'AllowedTruncate' 3. Return back to "Truncate Table Permissions.sql" 4. Execute Step 10 to cleanup! Modifications         : December 12, 2010 - NAV - Created ***************************************************************************************************************** */ -- Step 09A: Switch to the test database USE TruncateTestDB GO -- Step 09B: Ensure that we have valid data SELECT * FROM TruncatePermissionsTest GO -- (Expected: Following error will occur if logged in as "AllowedTruncate") -- Msg 229, Level 14, State 5, Line 1 -- The SELECT permission was denied on the object 'TruncatePermissionsTest', database 'TruncateTestDB', schema 'dbo'. --Step 09C: Attempt to Truncate Data from the table without using the stored procedure TRUNCATE TABLE TruncatePermissionsTest GO -- (Expected: Following error will occur) --  Msg 1088, Level 16, State 7, Line 2 --  Cannot find the object "TruncatePermissionsTest" because it does not exist or you do not have permissions. -- Step 09D:Regenerate Test Data INSERT INTO TruncatePermissionsTest VALUES (N'London'), (N'Paris'), (N'Berlin') GO -- (Expected: Following error will occur if logged in as "AllowedTruncate") -- Msg 229, Level 14, State 5, Line 1 -- The INSERT permission was denied on the object 'TruncatePermissionsTest', database 'TruncateTestDB', schema 'dbo'. --Step 09E: Attempt to Truncate Data from the table using the stored procedure EXEC proc_TruncateMyTable GO -- (Expected: Will execute successfully with 'AllowedTruncate' user, will error out as under with 'RestrictedTruncate') -- Msg 229, Level 14, State 5, Procedure proc_TruncateMyTable, Line 1 -- The EXECUTE permission was denied on the object 'proc_TruncateMyTable', database 'TruncateTestDB', schema 'dbo'. -- Step 09F:Regenerate Test Data INSERT INTO TruncatePermissionsTest VALUES (N'Madrid'), (N'Rome'), (N'Athens') GO --Step 09G: Attempt to Delete Data from the table without using the stored procedure DELETE FROM TruncatePermissionsTest GO -- (Expected: Following error will occur if logged in as "AllowedTruncate") -- Msg 229, Level 14, State 5, Line 2 -- The DELETE permission was denied on the object 'TruncatePermissionsTest', database 'TruncateTestDB', schema 'dbo'. -- Step 09H:Regenerate Test Data INSERT INTO TruncatePermissionsTest VALUES (N'Spain'), (N'Italy'), (N'Greece') GO --Step 09I: Attempt to Delete Data from the table using the stored procedure EXEC proc_DeleteMyTable GO -- (Expected: Following error will occur if logged in as "AllowedTruncate") -- Msg 229, Level 14, State 5, Procedure proc_DeleteMyTable, Line 1 -- The EXECUTE permission was denied on the object 'proc_DeleteMyTable', database 'TruncateTestDB', schema 'dbo'. --Step 09J: Close this SSMS window and return back to "Truncate Table Permissions.sql" Thank you Nakul to take up the challenge and prove that Ahmedabad and Gandhinagar SQL Server User Group has talent to solve difficult problems. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Best Practices, Pinal Dave, Readers Contribution, Readers Question, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >