Skip to main content

Running Opensuse Under Proxy

If you are running Opensuse under proxy environment then every time if you are logged in means you need to manually Goto Yast2->Network Services->Proxy settings to configure your network. The following blog post describes how to set proxy in detail:

In order to speed up the process, i had created a small script.

#!/bin/bash
echo "----------CONFIG PROXY--------------"
echo "1.set proxy"
echo "2.No proxy"
echo "Enter the choice : "
read choice
case $choice
 in
 1)
 echo "setting up Proxy"
 echo -e "
 PROXY_ENABLED=\"yes\" 
 GOPHER_PROXY=\"\" 
 NO_PROXY=\"localhost, 127.0.0.1\" 
 HTTP_PROXY=\"http://172.16.35.90:8080\" 
 HTTPS_PROXY=\"http://172.16.35.90:8080\" 
 FTP_PROXY=\"http://172.16.35.90:8080\"
 " > /etc/sysconfig/proxy
 echo "bye..."    
 ;;
2)
 echo "Unsetting the Proxy"
 echo -e "
 PROXY_ENABLED=\"no\" 
 GOPHER_PROXY=\"\"  
 NO_PROXY=\"localhost, 127.0.0.1\" 
 HTTP_PROXY=\"\" 
 HTTPS_PROXY=\"\" 
 FTP_PROXY=\"\" 
 " > /etc/sysconfig/proxy
 echo "bye..."         
 ;;
*)
 echo -e "Invalid Choice. Exiting  bye"
 ;;
esac

When Proxy variables are set/unset through the Script means, it gets updated  properly to /etc/sysconfig/proxy. Zypper,Install/Remove software and Firefox works fine by detecting the proxy settings. But the Problem is Google-Chrome, since Google Chrome uses System-proxy settings, the change in the environmental variables affects only after Logging off and re-Logging in. We can overcome this by using the  following command:


       google-chrome --proxy-server=http://172.16.35.90:8080




see man google-chrome for more info.

Comments

Popular posts from this blog

Android Studio Ninja Tip: Custom try/catch code template

As an Android Studio user, you should be familiar with the “ surround-with try-catch” functionality. Surround with try-catch When you use Ctrl+Alt+T (Linux) / Cmd+Alt+T (Mac) shortcut, the built-in try-catch generator auto generates a call to the printStackTrace() method of class Exception in the catch block. After this, we manually add some code to log the exception. e.g., Log.e(TAG, “Oops! something gone wrong”, e); As a power user, you may have used some or all of the following built-in Live templates: Live Templates You can save yourself the pain of these 5-keystrokes or repetitive typing or copy pasting the code by becoming a Ninja who uses a custom built-in try-catch template. Steps for customization Step-1 : Go to Android Studio Preferences | Editor | File and Code Templates Step-2:  Select Code | Catch Statement Body Step-3:  Replace the existing template from: ${EXCEPTION}.printStackTrace(); with: Log.e(getClass().getSimpleName(), "Ex

BSNL HUAWEI WLL Modem Installation

Hi everyone, Do u experience problem in connecting to Internet using BSNL WLL HUAWEI ETS 1201 from Ubuntu. Here is my Solution for it: Step 1 : Install Wvdial (a program that makes it easy to connect your Linux workstation to the Internet.). In Ubuntu there is a Dependency hell problem U need to download “Other Packages related to Wvdial” before installing Wvdial. I hope U will do it! After installation just check it by:   developer@ubuntu:~$ which wvdial     /usr/bin/wvdial When the above message is received then Your Wvdial installation is fine and we move to the next step Step 2 : Just run developer@ubuntu:~$sudo wvdialconf In my case I got the error as shown below: ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up. Modem Port Scan<*1>: S1 S2 S3 Sorry, no modem was detected! Is it in use by anothe

Android : Sharing code and resources between UI and unit tests

As an Android developer you are already familiar with writing Unit and UI tests. This post is about "How to share the code and resources between your UI and unit tests?". I'd used "Appointments List" as an example scenario for this post. Existing Setup For UI testing, I'd have list of appointments API response in JSON format as "appointments.json" in res directory. The .json file is is converted to AppointmentsListResponse using JsonParser. androidTest/java/com/example/AppointmentScreenTest.java AppointmentsListResponse getFakeAppointmentsResponse() { InputStream in = getInstrumentation ().getContext() .getResources() .openRawResource(com.example.android.internal.test.R.raw.appointments); AppointmentsListResponse fakeResponse = new JsonParser(in).parseTo(AppointmentsListResponse. class ); } androidTest/ java/ com/example/JsonParser.java public class JsonParser String mStringToParse; private static Gson mGso