Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

November 10, 2013

[SOLVED]Enable Hibernation in Ubuntu 13.10

sudo gedit /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Copy and paste below lines into the file and save it.

[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

Source: http://ubuntuhandbook.org/index.php/2013/10/enable-hibernation-ubuntu-13-10/

October 20, 2013

[SOLVED]grub rescue

After unfortunate partition deletion/recovery I landed in "grub rescue" prompt

This helped me to get into ubuntu and repair the

#list your partitions
ls


#try to list contents of your linux partition and finding grub folder
ls (hd0,msdos3)/boot/grub


#use this partition
set prefix=(hd0,msdos3)/boot/grub


#set mod
insmod normal


#boot
normal

[SOLVED]resume: libgcrypt version: 1.5.*

After some partition problems I got the message on boot
resume: libgcrypt version: 1.5.*

....waited for 5 minutes to get into my ubuntu
sudo apt-get remove hibernate

it doesn't solved the issue

I booted one more time and made
sudo apt-get autoremove

package "uswsusp" was removed

after that I got no more resume libgcrypt messages

[SOLVED]resume: libgcrypt version: 1.5.*

After some partition problems I got the message on boot
resume: libgcrypt version: 1.5.*
....waited for 5 minutes to get into my ubuntu
sudo apt-get remove hibernate
it doesn't solved the issue I booted one more time and made
sudo apt-get autoremove
package "uswsusp" was removed after that I got no more resume libgcrypt messages

[SOLVED]grub rescue

After unfortunate partition deletion/recovery I landed in "grub rescue" prompt This helped me to get into ubuntu and repair the #list your partitions
ls
#try to list contents of your linux partition and finding grub folder
ls (hd0,msdos3)/boot/grub
#use this partition
set prefix=(hd0,msdos3)/boot/grub
#set mod
insmod normal
#boot
normal

August 27, 2013

[SOLVED] Install NodeJS on Debian

For Debian Wheezy, your best bet is to compile node by yourself:
sudo apt-get install python g++ make checkinstall
mkdir ~/src && cd $_
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
checkinstall #(remove the "v" in front of the version number in the dialog)
sudo dpkg -i node_*

Uninstall:
sudo dpkg -r node

In case you get a permission denied on the node executable, an alternative path might be:
umask 0022
./configure
make
checkinstall -D --umask 0022 --reset-uids --install=no
dpkg -i node_*.deb

 

Source: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#debian-lmde

April 14, 2013

[SOLVED] Convert ogv to gif

First install this:

sudo apt-get install imagemagick mplayer gtk-recordmydesktop

On a terminal:

mplayer -ao null <video file name> -vo jpeg:outdir=output

Use ImageMagick to convert the screenshots into an animated gifs.

convert output/* output.gif

you can optimize the screenshots this way:

convert output.gif -fuzz 10% -layers Optimize optimised.gif

 

Source: http://askubuntu.com/a/107735/65087

April 10, 2013

[SOLVED] Recursive image optimisation for web

use jpegoptim for jpeg files and optipng for pngs.

save this code to the file e.g., optimize.sh
#!/bin/bash
optimize() {
  jpegoptim *.jpg --strip-all --all-progressive --max=90
  for i in *
  do
    if test -d $i
    then
      cd $i
      echo $i
      optimize
      cd ..
    fi
  done
  echo
}
optimize

change permissions:
chmod +x optimize.sh

and run it in desired folder:
./optimize.sh


or

find . -name "*.jpg" -exec jpegoptim --strip-all --all-progressive --max=90 {} \;


Source: http://jmperezperez.com/jpegoptim-optimize-jpg-page-speed/

March 23, 2013

[SOLVED] Fixed PHP Warning: Module 'apc' already loaded in Unknown on line 0

You are getting this message "[SOLVED] Fixed PHP Warning:  Module 'apc' already loaded in Unknown on line 0"

every time you execute the php in your console.

It means that you have already activated the apc.so extension.

You must check the second module activation.

Here you can find the apc.ini config file
$ locate apc.ini 
/etc/php5/conf.d/20-apc.ini
/etc/php5/mods-available/apc.ini

Now locate php.ini files and check them for uncommented "extension=apc.so" line
$ locate php.ini
/etc/php5/apache2/php.ini
/etc/php5/cgi/php.ini
/etc/php5/cli/php.ini

check files for uncommented "extension=apc.so"
$ cat /etc/php5/apache2/php.ini | grep apc.so
;extension=apc.so

Here you found it
$ cat /etc/php5/cli/php.ini | grep apc.so
extension=apc.so

 

Edit the file
 sudo vim /etc/php5/cli/php.ini

and add ";" before "extension=apc.so"

save it and you are done

 

Source: http://blog.ciuly.com/my-server/php-warning-module-apc-already-loaded-in-unknown-on-line-0/

 

 

 

December 3, 2012

[SOLVED] Linux: resize all images via console

Just install ImageMagick if you dont have it yet

sudo apt-get install imagemagick

Resize all JPG files in to desired size

mogrify -resize 640x480 *.jpg

Source: http://www.baptiste-wicht.com/2010/09/tip-batch-resize-images-on-ubuntu-linux/

October 11, 2012

[SOLVED] Install mod_pagespeed on ubuntu x64

Just run this in your console

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
sudo dpkg -i mod-pagespeed-*.deb
sudo apt-get -f install
sudo service apache2 restart

done. Now your page is faster. Check your page for chages - you will find many "pagespeed.ce.fm5FGAHKsn.css" like optimisations

 

More info on installation: https://developers.google.com/speed/docs/mod_pagespeed/download

September 5, 2012

[SOLVED] Hibernating your ubuntu via console

Just run this in console:
sudo /usr/sbin/pm-hibernate


For locking your session and hibernating just run:
gnome-screensaver-command -l && sudo /usr/sbin/pm-hibernate

August 23, 2012

[SOLVED] Fix permissons in linux

Just do:

to fix files permissions
find . -type f -exec chmod 644 {} \;

to fix folders permissions
find . -type d -exec chmod 755 {} \;

August 5, 2012

[SOLVED]No WebGL in Google Chrome v21 on Ubuntu 12.0

If your Google Chrome keeps saying you that your graphic card is not supported however you see WebGL stuff in your Firefox.

Just write
chrome://flags

in the adress bar of your chrome

And enable the "Override software rendering list Mac, Windows, Linux, Chrome OS".

Don't forget to restart the browser

August 3, 2012

[SOLVED]Connect Nexus 7 and/or Galaxy Nexus to ubuntu

You want to develop on your new shiny Nexus 7 and
adb devices

keeps giving you
???????? device

oprn your rules file
gksu gedit /etc/udev/rules.d/51-android.rules

probably you will see following line (if you already configured your Galaxy nexus) If not add it to the file, just in case
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666", OWNER="YOUR_USER_ID"

Now we should get the idVendor and idProduct from the Nexus 7. Connect it to your computer and
lsusb

you will see something like
Bus 001 Device 013: ID 18d1:4e42 Google Inc.

we need this two values

paste this string with proper values to 51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0666", OWNER="YOUR_USER_ID"

Save the file. Do the
sudo service udev restart

Now run
adb devices

you should see your device
List of devices attached
015d172c98280c0b device

Happy developing

Source: http://govfate.iteye.com/blog/1608379

June 8, 2012

[SOLVED] Android: Samsung Galaxy Tab 10.1 on Ubuntu

Just follow this tutorial http://forum.xda-developers.com/showthread.php?t=1077377

My 64bit RULES FILE:
ACTION!="add", GOTO="gtab_rules_end"
SUBSYSTEM!="usb|usb_device", GOTO="gtab_usb_end"

ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="685e", MODE="0777" SYMLINK+="gtab"

LABEL="gtab_usb_end"

LABEL="gtab_rules_end"

January 15, 2012

[SOLVED] Ubuntu: Fixing messed up screen resolution

If you messed up with your display resolution try this:
To configure the monitor and display adapter, you need to re-configure 
your Xorg server. To do that, first backup your xorg.conf file by
executing the following command:

# sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup

then, stop X by executing the following command (this will put you to
text only mode):

# sudo /etc/init.d/gdm stop

You can do the whole X configuration process by executing:

# sudo dpkg-reconfigure xserver-xorg

Once you have re-configured Xorg, start GNOME again by executing this
command:

# sudo /etc/init.d/gdm start


Source: lists.ubuntu.com

June 13, 2011

[SOLVED] Ubuntu - VNC loads but does not refresh.

I am playing with UltraVNC from Windows 7 to Ubuntu. To resolve the problem with VNC refresh we should turn off all visual effects.


 



right click on the desktop, select "Change Desktop Background", click
"Visual Effects", click the "none" option

 


Source: ubuntuforums.org

May 29, 2011

[SOLVED] Mount the remote file system on your local machine with sshfs

You can mount the remote file system on your local machine with sshfs:
mkdir -p /mnt/sshfs 
root@IS1300:~# sshfs 192.168.1.2:/ /mnt/sshfs 
root@IS1300:~# umount /mnt/sshfs

Then you can copy paste the file with nautilus/gnome/konqueror/dolphin/bash/whatever

 

Source: stackexchange.com