19 stycznia 2010

Gnome i nautilus dostanie sie do dysku bez hasła root-a

Gdy system pyta nas o hasło root-a gdy dostajemy sie do partycji NTFS lub FAT mozna uzyć takiego sposobu:



W pliku /usr/share/polkit-1/actions/org.freedesktop.devicekit.disks.policy i znajdź sekcję zaczynającą się od:

<action id="org.freedesktop.devicekit.disks.filesystem-mount-system-internal">
I zmień ją na taką (różni się tylko tymi allow*):
<action id="org.freedesktop.devicekit.disks.filesystem-mount-system-internal">
<description>Mount a system-internal device</description>
<description xml:lang="da">Montér en intern enhed</description>
<message>Authentication is required to mount the device</message>
<message xml:lang="da">Autorisering er p?kr?vet for at montere et fil system</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>

Informacje zaciągnięte z http://forum.fedora.pl

22 sierpnia 2009

Instalacja Broadcom b43[FEDORA]

Instalację sterowników do karty WIFI BROADCOM b43xx pod Fedora Linux mozna wykonać w następujący sposób:

yum install broadcom-wl


Jeśli to nie pomoże to dokładniejszy opis innej instalacji jest tutaj:

http://fedoramobile.org/fc-wireless/bcm43xx-yum-extras

24 lipca 2009

kodowanie i dekodowanie znaków Base64[JAVA]

Poniższa klasa koduje i dekoduje Stringa algorytmem Base64:

package webster.jdownloader;

/**
* A Base64 Encoder/Decoder.
*
* <p>
* This class is used to encode and decode data in Base64 
format as described in RFC 1521.
*
* <p>
* This is "Open Source" software and released under
 the <a href="http://www.gnu.org/licenses/lgpl.html">
GNU/LGPL</a> license.<br>
* It is provided "as is" without warranty of any kind.<br>
* Copyright 2003: Christian d'Heureuse, 
Inventec Informatik AG, Switzerland.<br>
* Home page: <a 
href="http://www.source-code.biz">www.source-code.biz</a><br>
*
* <p>
* Version history:<br>
* 2003-07-22 Christian d'Heureuse (chdh): Module created.<br>
* 2005-08-11 chdh: Lincense changed from GPL to LGPL.<br>
* 2006-11-21 chdh:<br>
*  &nbsp; Method encode(String) renamed to encodeString(String).<br>
*  &nbsp; Method decode(String) renamed to decodeString(String).<br>
*  &nbsp; New method encode(byte[],int) added.<br>
*  &nbsp; New method decode(String) added.<br>
*/

public class Base64 {

// Mapping table from 6-bit nibbles to Base64 characters.
private static char[]    map1 = new char[64];
static {
int i=0;
for (char c='A'; c<='Z'; c++) map1[i++] = c;
for (char c='a'; c<='z'; c++) map1[i++] = c;
for (char c='0'; c<='9'; c++) map1[i++] = c;
map1[i++] = '+'; map1[i++] = '/'; }

// Mapping table from Base64 characters to 6-bit nibbles.
private static byte[]    map2 = new byte[128];
static {
for (int i=0; i<map2.length; i++) map2[i] = -1;
for (int i=0; i<64; i++) map2[map1[i]] = (byte)i; }

/**
* Encodes a string into Base64 format.
* No blanks or line breaks are inserted.
* @param s  a String to be encoded.
* @return   A String with the Base64 encoded data.
*/

13 lipca 2009

Proxy[JAVA]

public void Proxy(boolean enable) {
if (enable == true) {
Properties systemSettings = System.getProperties();
systemSettings.put("http.proxyHost", "proxy_name");
systemSettings.put("http.proxyPort", "port_number");
System.setProperties(systemSettings);
}

}


Procedura ustanawiająca połączenie z proxy.