This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define in apt.conf | |
Acquire { | |
Retries "0"; | |
HTTP { | |
Proxy "http://username:[email protected]:8080"; | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The way to free memory arranged for Bitmaps in native memory or just not GC'ed | |
* @source <a href="http://stackoverflow.com/a/7783511/918211">StackOverflow Thread</a> | |
*/ | |
public static void stripImageView(ImageView view) { | |
if (view.getDrawable() instanceof BitmapDrawable) { | |
((BitmapDrawable) view.getDrawable()).getBitmap().recycle(); | |
} | |
view.getDrawable().setCallback(null); | |
view.setImageDrawable(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Logging Heap Info for Android | |
* @source <a href="http://stackoverflow.com/a/8018476/918211">StackOverflow Thread</a> | |
*/ | |
public static void logHeap(Class clazz) { | |
final String APP = "MyApp"; | |
Double allocated = new Double(Debug.getNativeHeapAllocatedSize())/1048576d; | |
Double available = new Double(Debug.getNativeHeapSize())/1048576.0d; | |
Double free = new Double(Debug.getNativeHeapFreeSize())/1048576.0d; | |
DecimalFormat df = new DecimalFormat(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--source: http://stackoverflow.com/a/3493919/918211--> | |
<plugin> | |
<artifactId>exec-maven-plugin</artifactId> | |
<groupId>org.codehaus.mojo</groupId> | |
<executions> | |
<execution><!-- Run our version calculation script --> | |
<id>Version Calculation</id> | |
<phase>generate-sources</phase> | |
<goals> | |
<goal>exec</goal> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before backup: | |
dpkg --get-selections > packages.txt | |
while restoring: | |
dpkg --clear-selections | |
dpkg --set-selections < packages.txt | |
aptitude install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get -y install aptitude | |
sudo aptitude -y full-upgrade | |
##most common used programs | |
sudo apt-get -y install aptitude eclipse scala htop mc powertop chromium-browser nautilus-scripts-manager flac quodlibet nautilus-open-terminal vim vim-gtk git subversion-tools p7zip-full mplayer openssh-server python-pip mesa-utils | |
#oracle jdk 7 | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get -y install oracle-java7-installer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mplayer -af scaletempo -speed 1.5 $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows | |
sudo mount /dev/sdax /mnt # make sure that sdax is correct! | |
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done | |
sudo chroot /mnt | |
#optional - if you have a separate boot partition | |
mount /boot | |
update-grub | |
grub-install /dev/sda | |
update-grub # I'm not sure if this is necessary, but it doesn't hurt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set correct path | |
HADOOP_HOME="/usr/lib/hadoop" | |
condition="" | |
fs="\t" | |
words="" | |
lines="" | |
chars="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#you'll need mencoder and x264 packages installed | |
#just add a video name like output.mp4 at the end | |
alias jpgtoh264="mencoder mf://*.jpg -nosound -of lavf -lavfopts format=mp4 -ovc x264 -x264encopts pass=1:bitrate=2000:crf=24 -mf type=jpg:fps=30 -o" |
OlderNewer