Search Results

Search found 1786 results on 72 pages for 'transparent'.

Page 7/72 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • iptables rules for DNS/Transparent proxy with ip exceptions

    - by SlimSCSI
    I am running a router (A Netgear WNDR3700 if that matters) with dd-wrt. For content filtering I am using OpenDNS. I wanted to make sure a user could not bypass OpenDNS by putting in their own name servers, so I have a rule to catch all DNS traffic. iptables -t nat -A PREROUTING -i br0 -p all --dport 53 -j DNAT --to $LAN_IP I did have one computer on the network I wanted to allow past OpenDNS filters. On that machine I manually set the name servers, and created another rule to allow it to pass iptables -t nat -I PREROUTING -i br0 -s 192.168.1.2 -j ACCEPT This worked well. Today, I installed a transparent proxy (squid) on the router and added these rules: iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d $LAN_NET -p tcp --dport 80 -j ACCEPT iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport 80 -j DNAT --to $PROXY_IP:$PROXY_PORT iptables -t nat -I POSTROUTING -o br0 -s $LAN_NET -d $PROXY_IP -p tcp -j SNAT --to $LAN_IP iptables -I FORWARD -i br0 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp --dport $PROXY_PORT -j ACCEPT This also works, however the 192.168.1.2 address does not get routed through squid. How can I have 192.168.1.2 (and maybe others in the future) by-pass the port 53 rules, but not the port 80 rules?

    Read the article

  • Fedora 17 transparent Ethernet Bridge not forwarding IP traffic

    - by mcdoomington
    I am running on Fedora 17 with the latest ebtables and have been trying to setup a transparent bridge - using the following script, I send a ping through the bridged host and only see the requests on the bridge (among other traffic from eth0), BUT, arps and arp replies are making it through. My host is setup - Client 192.168.1.10 <-- eth0 -- eth2 192.168.1.20 Ethernet script: #!/bin/sh brctl addbr br0; brctl stp br0 on; brctl addif br0 eth0; brctl addif br0 eth2; (ifdown eth0 1>/dev/null 2>&1;); (ifdown eth2 1>/dev/null 2>&1;); ifconfig eth0 0.0.0.0 up; ifconfig eth2 0.0.0.0 up; echo "1" > /proc/sys/net/ipv4/ip_forward; ebtables -P INPUT DROP ebtables -P FORWARD DROP ebtables -P OUTPUT DROP ebtables -A FORWARD -p ipv4 -j ACCEPT ebtables -A FORWARD -p arp -j ACCEPT Any assistance would be great!

    Read the article

  • Rewrite URL based off of IP on OpenWRT

    - by Scott
    We are running OpenWRT on a WRT54GL. I have been looking for an answer to this, but I can't seem to figure out what to search for, if its possible, or what combination of programs to use. I want to be able to redirect a HTTP request from a WiFi device based off of their MAC address. This should all be transparent to the device. Basically we are trying to redirect any non-registered devices to a website to register the device (at this point, we would push a new config to the router that would allow this MAC address "full access"). Once a device is registered, it will be redirected to a transparent squid proxy server on another machine for caching/blocking certain sites. I looked at tinyproxy - popilo which redirects but I won't have the MAC address to know if its registered or not. Any help (google suggestions, programs, anything!) would be very much appreciated!

    Read the article

  • XNA Alpha Blending to make part of a texture transparent

    - by David
    What I am trying to do is use alpha blending in XNA to make part of a drawn texture transparent. So for instance, I clear the screen to some color, lets say Blue. Then I draw a texture that is red. Finally I draw a texture that is just a radial gradient from completely transparent in the center to completely black at the edge. What I want is the Red texture drawn earlier to be transparent in the same places as the radial gradient texture. So you should be able to see the blue back ground through the red texture. I thought that this would work. GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(SpriteBlendMode.None); spriteBatch.Draw(bg, new Vector2(0, 0), Color.White); spriteBatch.End(); spriteBatch.Begin(SpriteBlendMode.None); GraphicsDevice.RenderState.AlphaBlendEnable = true; GraphicsDevice.RenderState.AlphaSourceBlend = Blend.One; GraphicsDevice.RenderState.AlphaDestinationBlend = Blend.Zero; GraphicsDevice.RenderState.SourceBlend = Blend.Zero; GraphicsDevice.RenderState.DestinationBlend = Blend.One; GraphicsDevice.RenderState.BlendFunction = BlendFunction.Add; spriteBatch.Draw(circle, new Vector2(0, 0), Color.White); spriteBatch.End(); GraphicsDevice.RenderState.AlphaBlendEnable = false; But it just seems to ignore all my RenderState settings. I also tried setting the SpriteBlendMode to AlphaBlend. It blends the textures, but that is not the effect I want. Any help would be appreciated.

    Read the article

  • java TrayIcon using image with transparent background

    - by Jack
    I am using the following code to set a tray icon in Windows and Linux. It works wonderful in Windows and works okay in Linux. In Linux (Ubuntu) I have my panel set to be (somewhat) transparent and when I add a GIF (with a transparent background) the background of the icon shows up all grey and ugly (see image, green diamond "!")....Any ideas on how to make the GIF image I am adding "keep" its transparent background? and the image I am using, if you'd like to test: import java.awt.*; import java.awt.event.*; public class TrayFun { static class ShowMessageListener implements ActionListener { TrayIcon trayIcon; String title; String message; TrayIcon.MessageType messageType; ShowMessageListener( TrayIcon trayIcon, String title, String message, TrayIcon.MessageType messageType) { this.trayIcon = trayIcon; this.title = title; this.message = message; this.messageType = messageType; } public void actionPerformed(ActionEvent e) { trayIcon.displayMessage(title, message, messageType); } } public static void main(String args[]) { Runnable runner = new Runnable() { public void run() { if (SystemTray.isSupported()) { final SystemTray tray = SystemTray.getSystemTray(); Image image = Toolkit.getDefaultToolkit().getImage("green_info.png"); PopupMenu popup = new PopupMenu(); final TrayIcon trayIcon = new TrayIcon(image, "The Tip Text", popup); trayIcon.setImageAutoSize(true); MenuItem item = new MenuItem("Close"); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { tray.remove(trayIcon); } }); popup.add(item); try { tray.add(trayIcon); } catch (AWTException e) { System.err.println("Can't add to tray"); } } else { System.err.println("Tray unavailable"); } } }; EventQueue.invokeLater(runner); } }

    Read the article

  • Improve my php image resizer to support alpha png and transparent GIFs

    - by David
    Hi, I use this function to resize images but i end up with ugly creepy image with a black background if it's a transparent GIF or PNG with alpha, however it works perfectly for jpg and normal png. function cropImage($nw, $nh, $source, $stype, $dest) { $size = getimagesize($source); $w = $size[0]; $h = $size[1]; switch($stype) { case 'gif': $simg = imagecreatefromgif($source); break; case 'jpg': $simg = imagecreatefromjpeg($source); break; case 'png': $simg = imagecreatefrompng($source); break; } $dimg = imagecreatetruecolor($nw, $nh); switch ($stype) { case "png": imagealphablending( $dimg, false ); imagesavealpha( $dimg, true ); $transparent = imagecolorallocatealpha($dimg, 255, 255, 255, 127); imagefilledrectangle($dimg, 0, 0, $nw, $nh, $transparent); break; case "gif": // integer representation of the color black (rgb: 0,0,0) $background = imagecolorallocate($simg, 0, 0, 0); // removing the black from the placeholder imagecolortransparent($simg, $background); break; } $wm = $w/$nw; $hm = $h/$nh; $h_height = $nh/2; $w_height = $nw/2; if($w> $h) { $adjusted_width = $w / $hm; $half_width = $adjusted_width / 2; $int_width = $half_width - $w_height; imagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h); } elseif(($w <$h) || ($w == $h)) { $adjusted_height = $h / $wm; $half_height = $adjusted_height / 2; $int_height = $half_height - $h_height; imagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h); } else { imagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h); } imagejpeg($dimg,$dest,100); } I use php 5.3.2 and the GD library bundled (2.0.34 compatible) Thanks

    Read the article

  • Set a color as transparent in palette-based image

    - by NeDark
    Hello there! I want to convert a alpha transparent png image to palette based png image. In GD I can do it easy: // We have already the image loaded in $source_img $w=200; $h=200; // We supose that img dimensions are 200x200 $img = imagecreatetruecolor($w, $h); // New black image list($r, $g, $b) = array(200, 200, 200); // Some color that doesn't appear in image to avoid conflict $color = imagecolorallocate($img, $r, $g, $b); imagefill($img, 0, 0, $color); // Fill the black image with the chosen color. imagecolortransparent($img, $color); // Set the chosen color as transparent $res = imagecopyresampled($img, $source_img, 0, 0, 0, 0, $w, $h, $w, $h); But in Imagick I don't know how set a color as transparent (imagecolortransparent() in GD). I have spent hours searching on the internet, but the help in the php site isn't very comphrensive and there are many undocumented functions. Thanks.

    Read the article

  • Odd squid transparent redirect behavior

    - by EMiller
    This is the first time I've set up squid. It's running a redirect script that does some text search/replace on html pages, and then saves them to a location on the same machine on the nginx path - then issues the redirect to that URL (it's an art project :D). The relevant lines in squid.conf are http_port 3128 transparent redirect_program /etc/squid/jefferson_redirect.py The jefferson_redirect.py script is based on this script: http://gofedora.com/how-to-write-custom-redirector-rewritor-plugin-squid-python/ The issue: I'm getting strange http redirect behavior. For example, here is the normal request/response from a PHP script that issues a header("Location:"); - a 302 redirect: http://redirector.mysite.com/?unicmd=g+yreka GET /?unicmd=g+yreka HTTP/1.1 Host: redirector.mysite.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.5.9-1.fc12 Firefox/3.5.9 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive HTTP/1.1 302 Found Date: Tue, 13 Apr 2010 05:15:43 GMT Server: Apache X-Powered-By: PHP/5.2.11 Location: http://www.google.com/search?q=yreka Content-Type: text/html Vary: User-Agent,Accept-Encoding Content-Encoding: gzip Content-Length: 2108 Keep-Alive: timeout=3, max=100 Connection: Keep-Alive Here's what it looks like when running through the squid proxy (note that "redirector.mysite.com" is not the site running squid or nginx): http://redirector.mysite.com/?unicmd=g+yreka GET /?unicmd=g+yreka HTTP/1.1 Host: redirector.mysite.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.5.9-1.fc12 Firefox/3.5.9 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Proxy-Connection: keep-alive If-Modified-Since: Tue, 13 Apr 2010 05:21:02 GMT HTTP/1.0 200 OK Server: nginx/0.7.62 Date: Tue, 13 Apr 2010 05:21:10 GMT Content-Type: text/html Content-Length: 17865 Last-Modified: Tue, 13 Apr 2010 05:21:10 GMT Accept-Ranges: bytes X-Cache: MISS from jefferson X-Cache-Lookup: HIT from jefferson:3128 Via: 1.1 jefferson:3128 (squid/2.7.STABLE6) Connection: keep-alive Proxy-Connection: keep-alive It is basically working - but the URL http://redirector.mysite.com/?unicmd=g+yreka remains unchanged, while displaying the google page (mostly broken as it's using URLs relative to redirector.mysite.com) I've experienced a similar thing with google results pages: when clicking to another page from google, I get a google URL, with the other site's content. Sorry for the long post - many thanks if you've read this far! Any ideas?

    Read the article

  • Transparent PNG menu item backgrounds in IE6 with rollovers

    - by evh
    Hi I have been trying to do this for what feels like all my life I have a list menu with block display links, each link has a sliding doors png background image. I have used this javascript (http://www.ideashower.com/our_solutions/png-hover/) to implement the alphaimageloader fix for ie6 using a transparent gif. When I test it for the first time it works but if I click to a different page and then click back it doesn't work anymore - the menu completely disappears, I can get it to work again by duplicating the transparent gif and changing it's name, but again if I go to another page and then come back to it, it stops working and the menu dissappears. Is this a server caching issue or something like that. Any thoughts on this would be much appreciated! Thanks

    Read the article

  • Transparent Proxy for IPv6 traffic under Linux

    - by Jerub
    When maintaining networks, it is often an expedient thing to do to run a transparent proxy. By transparent proxy I mean a proxy that 'hijacks' outgoing connections and runs them through a local service. Specifically I run a linux firewall with squid configured so that all tcp/ip connections fowarded on port 80 are proxied by squid. This is achived using the iptables 'nat' table, using IPv4. But iptables for IPv6 does not have a 'nat' table, so I cannot use the same implementation. What is a technique I can use to transparently proxy traffic for IPv6 connections? (this question has still not been answered adequately yet, a year on)

    Read the article

  • Alpha transparent PNGs not displaying correctly in Mobile Safari

    - by worksology
    I'm using some semi-transparent PNGs as background-images on various websites. These are usually something like a 1x1 image with a 30-percent opaque white layer. I've noticed that Mobile Safari does not display them correctly, giving them a darker/grayish tint. I've created a couple test pages to illustrate. View them both in your normal browser, and then on Mobile Safari, and you should see what I mean. This shows 11 red images of varying opacities on white: http://thecompleteworks.org/alpha-tests/index-red.html This shows 11 white images of varying opacities on blue: http://thecompleteworks.org/alpha-tests/index.html Is this a MobileSafari bug (I couldn't imagine so), or do I need to do something different, either to my pages or PNGs? (Here's how I create the PNGs: In Photoshop, create a 1x1 transparent canvas. Draw a white rectangle in Layer 1. Set opacity to, say 30 percent, Save for Web as 24-bit PNG with transparency.)

    Read the article

  • Blending transparent textures with depth

    - by l.thee.a
    I am trying to blend textures which have transparent areas: glEnable( GL_TEXTURE_2D ); glBindTexture( GL_TEXTURE_2D, ...); glVertexPointer( 2, GL_FLOAT, 0, ... ); glEnable (GL_BLEND); glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 ); Unless I add glDisable(GL_DEPTH_TEST), transparent parts of the top textures overwrite everything beneath them (instead of blending). Is there any way to do this without disabling depth? I have tried various blending functions but none of the helped.

    Read the article

  • Java Nimbus LAF with transparent text fields

    - by Software Monkey
    I have an application that uses disabled JTextFields in several places which are intended to be transparent - allowing the background to show through instead of the text field's normal background. When running the new Nimbus LAF these fields are opaque (despite setting setOpaque(false)), and my UI is broken. It's as if the LAF is ignoring the opaque property. Setting a background color explicitly is both difficult in several places, and less than optimal due to background images actually doesn't work - it still paints it's LAF default background over the top, leaving a border-like appearance (the splash screen below has the background explicitly set to match the image). Any ideas on how I can get Nimbus to not paint the background for a JTextField? Note: I need a JTextField, rather than a JLabel, because I need the thread-safe setText(), and wrapping capability. Note: My fallback position is to continue using the system LAF, but Nimbus does look substantially better. See example images below. Conclusions The surprise at this behavior is due to a misinterpretation of what setOpaque() is meant to do - from the Nimbus bug report: This is a problem the the orginal design of Swing and how it has been confusing for years. The issue is setOpaque(false) has had a side effect in exiting LAFs which is that of hiding the background which is not really what it is ment for. It is ment to say that the component my have transparent parts and swing should paint the parent component behind it. It's unfortunate that the Nimbus components also appear not to honor setBackground(null) which would otherwise be the recommended way to stop the background painting. Setting a fully transparent background seems unintuitive to me. In my opinion, setOpaque()/isOpaque() is a faulty public API choice which should have been only: public boolean isFullyOpaque(); I say this, because isOpaque()==true is a contract with Swing that the component subclass will take responsibility for painting it's entire background - which means the parent can skip painting that region if it wants (which is an important performance enhancement). Something external cannot directly change this contract (legitimately), whose fulfillment may be coded into the component. So the opacity of the component should not have been settable using setOpaque(). Instead something like setBackground(null) should cause many components to "no long have a background" and therefore become not fully opaque. By way of example, in an ideal world most components should have an isOpaque() that looks like this: public boolean isOpaque() { return (background!=null); }

    Read the article

  • Transparent Background with a Modal UIViewController

    - by Mick Walker
    I have a dilema, I want to present to the user a semi-transparent view. I found out by experimenting that if I simply pushed the transparent view to the top of my NavigationController's stack, that it would not render the transparency level I wanted. So I decided to simply add the view as a subview of the current view at the top of the stack. This solution works, the view below is still visible, and the View is 'semi-modal'. The problem is, if the parent view inherits from UITableViewController (as mine does), then the view I 'push' onto it, does not cover the navigation bar at the top. I really don't want to get into a situation where I am forced to enable / disable controls on the navigation bar every time I push this view, so I was wondering, if anyone knew of any solutions that I could use so that the view I push onto the UITableViewController will actually 'push over' the navigation bar?

    Read the article

  • CSS3 transparent gradient similar with Photoshop ColorPicker

    - by Mircea
    I try to create a transparent gradient with CSS. I need it for a color picker app. I have a transparent PNG I could use but its is 20kb large and would request a new HTTP request. The code should be ultralight. Here is what I've done so far: http://jsfiddle.net/78SEK/ The one above its the good one and the bottom one is made with CSS. I had also tryd something with HTML5 Canvas but I could not get the exact match. Is there a way I could do this? Thanx

    Read the article

  • How to Improve my php image resizer to support alpha png and transparent GIFs

    - by David
    Hi, I use this function to resize images but i end up with ugly creepy image with a black background if it's a transparent GIF or PNG with alpha, however it works perfectly for jpg and normal png. function cropImage($nw, $nh, $source, $stype, $dest) { $size = getimagesize($source); $w = $size[0]; $h = $size[1]; switch($stype) { case 'gif': $simg = imagecreatefromgif($source); break; case 'jpg': $simg = imagecreatefromjpeg($source); break; case 'png': $simg = imagecreatefrompng($source); break; } $dimg = imagecreatetruecolor($nw, $nh); switch ($stype) { case "png": imagealphablending( $dimg, false ); imagesavealpha( $dimg, true ); $transparent = imagecolorallocatealpha($dimg, 255, 255, 255, 127); imagefilledrectangle($dimg, 0, 0, $nw, $nh, $transparent); break; case "gif": // integer representation of the color black (rgb: 0,0,0) $background = imagecolorallocate($simg, 0, 0, 0); // removing the black from the placeholder imagecolortransparent($simg, $background); break; } $wm = $w/$nw; $hm = $h/$nh; $h_height = $nh/2; $w_height = $nw/2; if($w> $h) { $adjusted_width = $w / $hm; $half_width = $adjusted_width / 2; $int_width = $half_width - $w_height; imagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h); } elseif(($w <$h) || ($w == $h)) { $adjusted_height = $h / $wm; $half_height = $adjusted_height / 2; $int_height = $half_height - $h_height; imagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h); } else { imagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h); } imagejpeg($dimg,$dest,100); } Example : cropImage("300","200","original.png","png","new.png"); I use php 5.3.2 and the GD library bundled (2.0.34 compatible) How to make it support transparency? i've added imagealphablending() and imagesavealpha but it didn't work. Or atlast is there any similar good classes? Thanks

    Read the article

  • Override transparency color when converting transparent PNG to JPG

    - by Alexander Malfait
    I'm using Dragonfly to generate thumbnail images in a Rails app. I'm serving all picture images as JPG's. Now the client is uploading transparent PNG files, like this one: http://www.ibanez.co.jp/products/images/eg2010/ART120_TRF_12_02.png Dragonfly uses RMagick to convert these images to JPG. The problem is that it converts the PNG images to JPG with a black background, and my site's design requires a white background. I've tried to override it like this: encoded_image = Magick::Image.from_blob(image.data).first if encoded_image.format.downcase == format image # do nothing else encoded_image.format = format encoded_image.background_color = "white" encoded_image.transparent_color = "white" encoded_image.to_blob end But the produced JPG images still contain a black background. Does anyone know how to beat RMagick into using a white background when converting the transparent layer? I know I could just serve as PNG, but then the images are 10 times as large, and the site is already pretty bandwidth heavy.

    Read the article

  • CSS: semi-transparent background, but not text

    - by Stijn Sanders
    Is there a way in CSS to make the background of an element semi-transparent, but still have the text of the element non-transparent? (Without separating the text and background in two elements positioned over eachother.) I've tried <p style="position:absolute;background-color:green;filter:alpha(opacity=60);opacity:.6;"><span style="color:white;filter:alpha(opacity=100);opacity:1;">Hello world</span></p> But it looks like child elements are subjected to the opacity of their parent(s), so 'opacity:1' is still drawn as 'opacity:.6' from the parent.

    Read the article

  • Masking to Transparent returns empty image

    - by Tibi
    Hi there, I'm trying to put white color in my images to transparent with the following code. Problem is that "CGImageRef maskedTransparent" is blank. I don't understand because the code I'm using is nearly a copy paste from the doc ... Any idea ? (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage { CGImageRef maskRef = maskImage.CGImage; CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef), CGImageGetHeight(maskRef), CGImageGetBitsPerComponent(maskRef), CGImageGetBitsPerPixel(maskRef), CGImageGetBytesPerRow(maskRef), CGImageGetDataProvider(maskRef), NULL, false); CGImageRef masked = CGImageCreateWithMask([image CGImage], mask); //Array defining min & max RGB values to be transformed to transparent colors. float maskingMinMax[6] = {255, 255, 255, 255, 255, 255}; //masking image to remove range in maskinLinMax CGImageRef maskedTransparent = CGImageCreateWithMaskingColors(masked, maskingMinMax); return [UIImage imageWithCGImage:maskedTransparent]; }

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >