Saturday 17 October 2015

Saturday 3 October 2015

KB CMStorm - Backlight issue - Slackware

run the command:
xmodmap -e 'add mod3 = Scroll_Lock'

Tuesday 10 March 2015

SCP examples

 

Source: http://www.hypexr.org/linux_scp_help.php

Example syntax for Secure Copy (scp)

What is Secure Copy?

scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Examples

Copy the file "foobar.txt" from a remote host to the local host

    $ scp your_username@remotehost.edu:foobar.txt /some/local/directory

Copy the file "foobar.txt" from the local host to a remote host

    $ scp foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy the directory "foo" from the local host to a remote host's directory "bar"

    $ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar

Copy the file "foobar.txt" from remote host "rh1.edu" to remote host "rh2.edu"

    $ scp your_username@rh1.edu:/some/remote/directory/foobar.txt \
    your_username@rh2.edu:/some/remote/directory/

Copying the files "foo.txt" and "bar.txt" from the local host to your home directory on the remote host

    $ scp foo.txt bar.txt your_username@remotehost.edu:~

Copy the file "foobar.txt" from the local host to a remote host using port 2264

    $ scp -P 2264 foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy multiple files from the remote host to your current directory on the local host

    $ scp your_username@remotehost.edu:/some/remote/directory/\{a,b,c\} .
    $ scp your_username@remotehost.edu:~/\{foo.txt,bar.txt\} .

scp Performance

By default scp uses the Triple-DES cipher to encrypt the data being sent. Using the Blowfish cipher has been shown to increase speed. This can be done by using option -c blowfish in the command line.
    $ scp -c blowfish some_file your_username@remotehost.edu:~
It is often suggested that the -C option for compression should also be used to increase speed. The effect of compression, however, will only significantly increase speed if your connection is very slow. Otherwise it may just be adding extra burden to the CPU. An example of using blowfish and compression:
    $ scp -c blowfish -C local_file your_username@remotehost.edu:~

Contributions

Thanks Stewart Macleod for port example.

Friday 13 February 2015

Convert mkv to mp4

ffmpeg -i file.mkv -vcodec copy -acodec copy file.mp4

Thursday 12 February 2015

Install Vmware Workstation 11 on Slackware 14.1

./VMware-Workstation-Full-10.0.2-1744117.x86_64.bundle  --console --custom --eulas-agreed -I --regular


if you get the error message when creating a new image:

“Error: Could not open /dev/vmmon: No such file or directory. Please make sure that the kernel module vmmon is loaded.”

Solution:

vmware-modconfig --console --install-all

 

Saturday 7 February 2015

Bash shell - moving faster

Source:
http://teohm.com/blog/2012/01/04/shortcuts-to-move-faster-in-bash-command-line/

Basic moves

  • Move back one character. Ctrl + b
  • Move forward one character. Ctrl + f
  • Delete current character. Ctrl + d
  • Delete previous character. Backspace
  • Undo. Ctrl + -

Moving faster

  • Move to the start of line. Ctrl + a
  • Move to the end of line. Ctrl + e
  • Move forward a word. Meta + f (a word contains alphabets and digits, no symbols)
  • Move backward a word. Meta + b
  • Clear the screen. Ctrl + l
What is Meta? Meta is your Alt key, normally. For Mac OSX user, you need to enable it yourself. Open Terminal > Preferences > Settings > Keyboard, and enable Use option as meta key. Meta key, by convention, is used for operations on word.

Cut and paste (‘Kill and yank’ for old schoolers)

  • Cut from cursor to the end of line. Ctrl + k
  • Cut from cursor to the end of word. Meta + d
  • Cut from cursor to the start of word. Meta + Backspace
  • Cut from cursor to previous whitespace. Ctrl + w
  • Paste the last cut text. Ctrl + y
  • Loop through and paste previously cut text. Meta + y (use it after Ctrl + y)
  • Loop through and paste the last argument of previous commands. Meta + .

Search the command history

  • Search as you type. Ctrl + r and type the search term; Repeat Ctrl + r to loop through results.
  • Search the last remembered search term. Ctrl + r twice.
  • End the search at current history entry. Ctrl + j
  • Cancel the search and restore original line. Ctrl + g

Thursday 22 January 2015

Premium Link Generators

http://www.exrapidleech.info/index.php
http://generatorlinkpremium.com/
http://debridx.com/download

Wednesday 21 January 2015

Fix : Google Chrome can not be run as Root user

" Google Chrome can not be run as Root user Please Start Google Chrome as a normal user. To run as Root, you must specify an alternate –user–data-Dir for storage of profile information. "
Edit file: #vim /opt/google/chrome/google-chrome
change the line:
exec -a “$0″ “$HERE/chrome” “$PROFILE_DIRECTORY_FLAG” \
to: exec -a “$0″ “$HERE/chrome” –user-data-dir “$PROFILE_DIRECTORY_FLAG” \

Make Firefox for Linux use Dolphin to ‘Open Containing Folder’

KDE --> System Settings --> File Associations --> inode/directory --> move Dolphin up to the first position

Monday 19 January 2015

git diff showing a weird output

Source: http://www.jpichon.net/blog/2013/05/git-diff-showing-weird-output/ Either of these commands things works well: $ git --no-pager diff # No paging $ git diff --color | less -R # With paging #export LESS='-M -R'

Monday 12 January 2015

Django - Translation check list

1. Mark your text for translation. ex: a. In template: using {% load i18n %} (at the top but have to be after the 'extends' tag) and {% trans 'text to be translated' %} b. in your code: from django.utils.translation import ugettext as _ ; _('Your text to be translated here') 2. Build the message file for language translations (creating .po files: ./manage makemessages -l vi (my django-admin.py doesn't work for me) You can run this again to reexamine the other text 3. Compile messages files ./manage compilemessages (do this again after you make changes to your po file 4. settings file LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), ) LANGUAGE_CODE = 'vi' 5. use URL international with i18n_patterns and set_length() add django.middleware.locale.LocaleMiddleware to MIDDLEWARE_CLASSES Use this form to set user's language preference
{% csrf_token %}
6.Others: TEMPLATE_CONTEXT_PROCESSORS += ( 'django.core.context_processors.request', ) add this to use request.get_full_path in your template

Friday 9 January 2015

Activating Unicode/UTF-8 Support and Changing Default Locale Language in Slackware

Source: http://gnu-linux-slackware.blogspot.com/2009/06/changing-system-wide-default-language.html For a list of locales which are supported by your Slackware box, type: $ locale -a If you have full installation of Slackware, all languages will be listed. To get UTF-8 support, edit lang.sh file as root by: # nano /etc/profile.d/lang.sh Comment default locale and add uncommented line export LANG=en_US.UTF-8 After modifying lang.sh file, save it and reboot your computer.

Thursday 8 January 2015

Konsole command -the text starts from the same line overwriting the prompt

Try enclosing each of the colour escape sequences in escaped square brackets. ex: PS1='\[\e[0;31m\]\t\[\e[m\]-\[\e[0;32m\]\u\[\e[m\]@\[\e[0;36m\]\h\[\e[m\]:\[\e[0;23m\]\w\[\e[m\e[0;32m\]\$\[\e[m\]'