Friday, December 28, 2012
remove items from the debian menu
Easier than i thought. Look for .desktop files for the application you want to remove in .local/share/applications and /usr/share/applications
Real firefox on debian
Courtesy of http://superuser.com/questions/322376/how-to-install-real-firefox-on-debian(apt-get remove iceweasel first if you have it installed) sudo apt-get remove iceweasel
sudo echo -e "\ndeb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" | tee -a /etc/apt/sources.list > /dev/null
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C1289A29
sudo apt-get update
sudo apt-get install firefox-mozilla-build
remove unnecessary packages from your debian install
sudo aptitude remove `deborphan --guess-all`
nothing to it.
if you then want to free up disk space by getting rid of all the deb packages apt has cached, run
sudo aptitude autoclean
nothing to it.
if you then want to free up disk space by getting rid of all the deb packages apt has cached, run
sudo aptitude autoclean
Tuesday, September 11, 2012
For the ultra paranoid... randomizing your MAC address.
I recently wanted to write some python since I've been relegated to the worlds of Java and sometimes C being a college student again. As a fun and paranoid project, I put together a little script that generates a random mac address and optionally assigns that MAC address to an interface and restarts your network connection.
I initially haven't made it all that complicated or general purpose (for instance, it assumes you're using network-manager, as I guess most of us are now). The relevant functions are below, but I'd be happy to post the whole script or make it more versatile / general if anyone is interested... post a comment or send me an email.
def mac():
"""
Returns a randomly generated Unicast MAC Address.
Returns:
String - A mac address.
"""
mac = '';
i = 0
count = 6
while i < count:
# If the least significant bit of the first bite is onw,
# ifconfig will fail because those addrs are reserved for multicast
odd_hex = ['1', '3', '5', '7', '9', 'b', 'd', 'f']
octet = hex(random.randint(0, 255))
octet = octet.replace('0x', '')
if len (octet) == 1:
octet = '0' + octet
if (i != 0) or (octet[len(octet)-1] not in odd_hex):
mac += octet
if i != 5:
mac += ':'
i=i+1
return mac
def restartNetwork(iface):
"""
Assign a random mac address to the given interface and
restarts network-manager to pick up the changes.
TODO: error checking for a valid iface.
Args:
iface: String representing an assumed valid network interface.
"""
new_mac = mac()
subprocess.call(['/etc/init.d/network-manager', 'stop'])
ifconfig = ['/sbin/ifconfig', iface, 'down']
subprocess.call(ifconfig)
#print subprocess.call('/sbin/ifconfig')
ifconfig = ['/sbin/ifconfig', iface, 'hw','ether', new_mac]
subprocess.call(ifconfig)
subprocess.call(['/etc/init.d/network-manager', 'start'])
print "If everything went as planned, %s should now have " \
"mac address:" % iface
print new_mac
I initially haven't made it all that complicated or general purpose (for instance, it assumes you're using network-manager, as I guess most of us are now). The relevant functions are below, but I'd be happy to post the whole script or make it more versatile / general if anyone is interested... post a comment or send me an email.
def mac():
"""
Returns a randomly generated Unicast MAC Address.
Returns:
String - A mac address.
"""
mac = '';
i = 0
count = 6
while i < count:
# If the least significant bit of the first bite is onw,
# ifconfig will fail because those addrs are reserved for multicast
odd_hex = ['1', '3', '5', '7', '9', 'b', 'd', 'f']
octet = hex(random.randint(0, 255))
octet = octet.replace('0x', '')
if len (octet) == 1:
octet = '0' + octet
if (i != 0) or (octet[len(octet)-1] not in odd_hex):
mac += octet
if i != 5:
mac += ':'
i=i+1
return mac
def restartNetwork(iface):
"""
Assign a random mac address to the given interface and
restarts network-manager to pick up the changes.
TODO: error checking for a valid iface.
Args:
iface: String representing an assumed valid network interface.
"""
new_mac = mac()
subprocess.call(['/etc/init.d/network-manager', 'stop'])
ifconfig = ['/sbin/ifconfig', iface, 'down']
subprocess.call(ifconfig)
#print subprocess.call('/sbin/ifconfig')
ifconfig = ['/sbin/ifconfig', iface, 'hw','ether', new_mac]
subprocess.call(ifconfig)
subprocess.call(['/etc/init.d/network-manager', 'start'])
print "If everything went as planned, %s should now have " \
"mac address:" % iface
print new_mac
Sunday, December 25, 2011
Installing cinnamon on LMDE
Installs but does not run.... working on it... please comment if you've had better luck.
Follow instructions to upgrade to gnome-shell 3.2 here:
http://forums.linuxmint.com/viewtopic.php?f=197&t=89327
Dependencies, even on the debian package, have the wrong package name, though some of these can be upgraded -- look for equivalent packages in your debian repos (in sid and experimental as well).
once you've upgraded everything you can, and have downloaded cinnamon run something like this:
sudo dpkg --ignore-depends=libecal1.2-10,libedataserver1.2-15,libgjs0c,libmozjs185-1.0,libpulse-mainloop-glib0,libpulse0 -i Downloads/cinnamon_1.1.2_amd64.deb
Follow instructions to upgrade to gnome-shell 3.2 here:
http://forums.linuxmint.com/viewtopic.php?f=197&t=89327
Dependencies, even on the debian package, have the wrong package name, though some of these can be upgraded -- look for equivalent packages in your debian repos (in sid and experimental as well).
once you've upgraded everything you can, and have downloaded cinnamon run something like this:
sudo dpkg --ignore-depends=libecal1.2-10,libedataserver1.2-15,libgjs0c,libmozjs185-1.0,libpulse-mainloop-glib0,libpulse0 -i Downloads/cinnamon_1.1.2_amd64.deb
Wednesday, December 14, 2011
Hades simulation framework.
Taking a computer architecture class, I'm immersed regularly in something known as hades simulation framework. Whether or not the name was intentional matters not. This is like being in hell. An interesting hell, but not a user friendly one. If you don't know what it is, feel blessed. If you do, you know there's very little info about troubleshooting on the internet. Some quick and dirty notes:
If subdesigns don't show up properly, you can make your own .sym file and specify port locations, names, etc. An example is below:
hades.symbols.BboxRectangle 0 0 4000 2600
hades.symbols.Rectangle 0 0 4000 2600
hades.symbols.InstanceLabel 150 450 1bit4to1MUX
hades.symbols.PortLabel 150 350 I0
hades.symbols.PortSymbol 0 200 I0
hades.symbols.PortLabel 150 950 I1
hades.symbols.PortSymbol 0 800 I1
hades.symbols.PortLabel 150 1550 I2
hades.symbols.PortLabel 150 2150 I3
hades.symbols.PortSymbol 0 2000 I3
hades.symbols.PortSymbol 0 1400 I2
hades.symbols.PortLabel 2800 350 S0
hades.symbols.PortSymbol 4000 200 S0
hades.symbols.PortLabel 2800 950 S1
hades.symbols.PortSymbol 4000 800 S1
hades.symbols.PortLabel 2800 1550 Output
hades.symbols.PortSymbol 4000 1400 Output
There are a number of reasons subdesigns will appear to be non functional or not respond in a larger design... I'll try to add to these as I find more:
1. Output named "Y" -- I've had success with this, but it seems to be unpredictable. Avoid it.
2. Edits to subdesigns will sometimes disconnect ports in larger designs. An easy way to test if this has happened is to move the subdesign in the larger design... wires should stay connected, if they don't, well, there you go... delete segments nearest your connections and then add segments to the original wire and reconnect.
3. In your subdesigns, set all your Ipins to default to 0. Defaulting to undefined can cause problems in larger designs.
4. you can't depend on Ipin vectors to take default values. Plan ahead on how to get data in.
I'm sure that there are more tips, but the semester is over and hades is slowly seeping out of mind. However, if you've stumbled across this and are knee deep in hades issues, go ahead and send an email, maybe i can help.
If subdesigns don't show up properly, you can make your own .sym file and specify port locations, names, etc. An example is below:
hades.symbols.Rectangle 0 0 4000 2600
hades.symbols.InstanceLabel 150 450 1bit4to1MUX
hades.symbols.PortLabel 150 350 I0
hades.symbols.PortSymbol 0 200 I0
hades.symbols.PortLabel 150 950 I1
hades.symbols.PortSymbol 0 800 I1
hades.symbols.PortLabel 150 1550 I2
hades.symbols.PortLabel 150 2150 I3
hades.symbols.PortSymbol 0 2000 I3
hades.symbols.PortSymbol 0 1400 I2
hades.symbols.PortLabel 2800 350 S0
hades.symbols.PortSymbol 4000 200 S0
hades.symbols.PortLabel 2800 950 S1
hades.symbols.PortSymbol 4000 800 S1
hades.symbols.PortLabel 2800 1550 Output
hades.symbols.PortSymbol 4000 1400 Output
There are a number of reasons subdesigns will appear to be non functional or not respond in a larger design... I'll try to add to these as I find more:
1. Output named "Y" -- I've had success with this, but it seems to be unpredictable. Avoid it.
2. Edits to subdesigns will sometimes disconnect ports in larger designs. An easy way to test if this has happened is to move the subdesign in the larger design... wires should stay connected, if they don't, well, there you go... delete segments nearest your connections and then add segments to the original wire and reconnect.
3. In your subdesigns, set all your Ipins to default to 0. Defaulting to undefined can cause problems in larger designs.
4. you can't depend on Ipin vectors to take default values. Plan ahead on how to get data in.
I'm sure that there are more tips, but the semester is over and hades is slowly seeping out of mind. However, if you've stumbled across this and are knee deep in hades issues, go ahead and send an email, maybe i can help.
Monday, August 29, 2011
Installing awn on LMDE XFCE without adding crazy gnome dependencies
sudo apt-get install libdesktop-agnostic0 libdesktop-agnostic-vfs-gio libdesktop-agnostic-fdo-glib libdesktop-agnostic-cfg-gconf gconf2 libnotify4
now, download this package:
http://packages.debian.org/wheezy/libawn1
and
sudo dpkg -i libawn1_0.4.1~bzr830-1_amd64.deb
(modify for your arch, of course)
now download this package:
http://packages.debian.org/wheezy/all/avant-window-navigator-data/download
and sudo dpkg -i for the downloaded file.
Now, you should be able to download the actual avant-window-manager package from here:
http://packages.debian.org/wheezy/avant-window-navigator
and run dpkg like so:
sudo dpkg --ignore-missing gnome-applets --ignore-missing gnome-applets-data --ignore-missing gnome-control-center --ignore-missing gnome-panel --ignore-missing gnome-panel-data --ignore-missing gnome-session --ignore-missing nautilus --ignore-missing nautilus-data -i avant-window-navigator_0.4.1~bzr830-1_amd64.deb
Again, modified for your arch.
Now you have awn installed, but you're still not going to have very many applets... if you search through the repos, you will be able to install some of the applets without gnome dependencies, but many of them *depend* on gnome-applets. Not to worry, we can install that without proper gnome as well.
First we need gnome-applets-data, which does not require any extra gnome nastiness.
sudo apt-get install gnome-applets-data
Then download this package:
http://packages.debian.org/squeeze/gnome-applets
now run:
sudo dpkg --ignore-depends gnome-control-center --ignore-depends gnome-panel --ignore-depends gnome-panel-data --ignore-depends gnome-session --ignore-depends nautilus --ignore-depends nautilus-data -i gnome-applets_2.30.0-3_amd64.deb
As usual, modifying for your archicture. I found that installing the additional awn applet packages was slightly problematic and kept breaking things because gnome-applets keeps wanting to pull in gnome-panel. If you see this breakage, run:
sudo aptitude -f install
Allow it to uninstall gnome-applets and then re-run the install cmd above. Ultimately I had to download and install awn-applets-c-core with dpkg.
Now, not *everything* works. A few of the applets crash, but the vast majority of things work just as they do in gnome, but without pulling in and running gnome-session and nautilus which really screw with the xfce user experience. I will update this as I continue to debug some og the problems, but I'm happy to have a decent dock under xfce!
Subscribe to:
Posts (Atom)