Käyttäjä:Masa

Kulmapaikasta
Versio hetkellä 19. marraskuuta 2012 kello 13.36 – tehnyt Masa (keskustelu | muokkaukset) (Add a note about *.desktop files)
Siirry navigaatioon Siirry hakuun

masa on noob.

masa on myöskin sähkötekniikkaa "opiskeleva" noob.

masa ylläpitää omaa palvelintaan, jonka nimi on tällä hetkellä dual. dualilla pyörii irssi, webbiserveri, pellettipolttimen logitussoftat ja suurelle yleisölle on tarjolla 24/7 toimiva Hard-vaikeustason KillingFloor-palvelin. Suunnitelmissa on tarjota lisää pelipalvelimia, kunhan joskus saan paremman nettiyhteyden kotiin.


Gnome 3 keyboard shortcuts

dconf-editor -> org.gnome.desktop.wm.keybindings

Get rid of the annoying sub-window thingies

Open: dconf-editor
Browse to: org -> gnome -> shell -> overrides -> attach-modal-dialogs
And set it to: false

Fix the clock

dconf-editor
org.gnome.shell.clock -> set show-date and show-seconds to true

Add the minimize button

gnome-tweak-tool (Advanced Settings)
Shell -> Arrangement of buttons on the title bar

Gnome 3 application shortcuts/names/icons (with shell search)

Add and edit *.desktop files located in:
/usr/share/applications/<name>.desktop
/usr/local/share/applications/<name>.desktop
~/.local/share/applications/<name>.desktop

Gnome 3 extensiot ja konffeja

Asennettuna, käytössä:

(* https://github.com/simon04/gnome-shell-extension-weather kuollut?)

Asennettuna, ei käytössä:
Ei asennettuna, mutta mielenkiintoisia tms:

Gnome 3 extensioiden konffeja

Evil Status Icon Forever

~/.local/share/gnome-shell/extensions/EvilStatusIconForever@bone.twbbs.org.tw/extensions.js /*****************************************************

* Statuc Icon Settings
****************************************************/

// Add application you want it shows thier notification status // icon on top bar to the following list.

// You may use top/htop to find out the name of application.


var notification = [

   'pidgin',       // Pidgin IM Client
   'hime',         // HIME Imput Method Editor
   'dropbox',      // Drop Box
   'linuxdcpp',    // LinuxDC++
   'mail-notification',// mail-notification
   'firefox',          // Firefox with FireTray
   'skype'             // Skype

// 'deadbeef', // Deadbeef Music Player // 'gcin', // GCIN Chinese Input Method // 'thunderbird-bin', // Thunderbird-bin (Gentoo binary package) // 'thunderbird', // Thunderbird // 'firefox-bin', // Firefox-bin (Gentoo binary package) // 'workrave', // Workrave // 'gajim', // Gajim // 'wicd-client.py', // Wicd-gtk ]

// Add which built-in status icon you want to remove in the // following list. //

var removeStatusIcon = [

   'a11y',         // Accessibility
   // 'volume',
   // 'battery',
   // 'keyboard',
   // 'bluetooth',
   // 'network'

]

/******************************************************

* Don't touch anything below!
*****************************************************/

gnome-shell-extension-weather

git clone git://github.com/simon04/gnome-shell-extension-weather.git gnome-shell-extension-weather.git cd gnome-shell-extension-weather.git git checkout gnome3.4 ./autogen.sh --prefix=/usr make sudo make install

gsettings set org.gnome.shell.extensions.weather unit celsius gsettings set org.gnome.shell.extensions.weather wind-speed-unit m/s gsettings set org.gnome.shell.extensions.weather city Lappeenranta gsettings set org.gnome.shell.extensions.weather show-sunrise-sunset true gsettings set org.gnome.shell.extensions.weather woeid FIXX0040

Gnome 3 default applications

nano /usr/share/applications/mimeinfo.cache nano ~/.local/share/applications/mimeapps.list

For default file manager, have this: inode/directory=nautilus.desktop;Thunar-folder-handler.desktop;

Random shell scriptejä

Safely shutdown a SATA hard drive (spins it down). Umount first! Usage example: scsiremove /dev/sdb

/usr/local/bin/scsiremove (needs sys-block/scsiadd and sys-fs/lsscsi):

  1. !/bin/sh

if [ $# -ne 1 ]; then

       echo "Usage: $0 <device>"
       exit 1

fi

if ! which lsscsi >/dev/null 2>&1; then

       echo "Error: lsscsi not installed";
       exit 1

fi

if ! which scsiadd >/dev/null 2>&1; then

       echo "Error: scsiadd not installed"
       exit 1

fi

device=`lsscsi | grep $1`

if [ -z "$device" ]; then

       echo "Error: could not find device: $1"
       exit 1

fi

hcil=`echo $device | awk \ '{split(substr($0, 2, 7),a,":"); print a[1], a[2], a[3], a[4]}'`

scsiadd -r $hcil


Merge together video files in matroska containers (needs media-video/mkvtoolnix).

/usr/local/bin/merge.sh:

  1. !/bin/bash

ALL="empty" DSTDIR=${1} FILES=${2}

for i in $(ls ${FILES}*) do

       if [ "$ALL" = "empty" ]; then
               ALL=${i}
               FIRST=${i}
       else
               ALL="${ALL} + ${i}"
       fi

done

  1. COMBINED=$(basename $FIRST | sed "s/\.mkv/_all.mkv/")

COMBINED=`basename ${FIRST} | sed "s/\.\([a-zA-Z0-9]\{1,10\}\)$/_all\.\1/"`

if [ -f "${DSTDIR}${COMBINED}" ]; then

       echo "Error: the target file already exists!"
       exit

fi

  1. echo "mkvmerge $ALL -o ${DSTDIR}${COMBINED}"

mkvmerge $ALL -o ${DSTDIR}${COMBINED} touch ${DSTDIR}${COMBINED} -r ${FIRST}


Encode videos into matroska container, with Ogg Vorbis audio and h.264 video (with x264 library). Needs media-video/ffmpeg, media-libs/libvorbis and media-libs/x264.

encode.sh

  1. !/bin/bash

SRCDIR=/home/masa/Media/Fraps/Fraps/ DSTDIR=/home/masa/ware/dc/f/

SAVEIFS=$IFS IFS=$(echo -en "\n\b")

for i in $(ls ${SRCDIR}javaw*avi)

  1. for i in $(ls ${SRCDIR}KillingFloor*avi)
  2. for i in $(ls ${SRCDIR}*.avi)
  3. for i in $(ls ${SRCDIR}Terraria*avi)

do

  1. DST=$(echo ${i/avi/mkv})
  2. DST=$(echo ${i/ /_})

i=$(basename $i | sed "s/^\.\///")

  1. DST=$(echo $i | sed "s/avi/mkv/" | sed "s/ /_/g")
  2. DST=$(echo $i | sed "s/mpeg/mkv/" | sed "s/ /_/g")

DST=$(echo $i | sed "s/\.[a-zA-Z0-9]\{1,10\}$/\.mkv/" | sed "s/ /_/g")

  1. echo "$i -> $DST"
  1. Tämä on se perinteinen:

ffmpeg -i ${SRCDIR}"${i}" -c:a libvorbis -b:a 96k\ -r 25 -c:v libx264 -preset slow -crf 25 -threads 0\ -f matroska ${DSTDIR}${DST}

chown masa:masa ${DSTDIR}${DST} chmod 644 ${DSTDIR}${DST} touch ${DSTDIR}${DST} -r ${SRCDIR}"${i}"

done IFS=$SAVEIFS

Funtoon tärkeimmät konffit

/etc/portage/package.use: app-misc/gentoo -nls -fam app-misc/tracker -applet app-portage/eix -deprecated app-portage/layman -bazaar -cvs git -mercurial -subversion app-text/lcdf-typetools kpathsea # for texlive dev-embedded/openocd ftdi segger usb versaloon dev-java/sun-jdk nsplugin dev-lang/python sqlite dev-libs/folks eds # +eds for folks required by gnome-contacts via Gnome 3.4 upgrade dev-libs/libxml2 icu # chromium (via deps?) needs +icu dev-util/cmake -qt4 dev-vcs/git gtk tk gnome-base/gdm -fallback gnome-base/gnome -fallback gnome-base/gnome-vfs -gnutls gnome-base/gvfs cdda gdu -udisks mail-client/mail-notification gmail imap pop ssl media-gfx/blender -ffmpeg # compilation fails with ffmpeg support enabled, probably because of ffmpeg -> libav change (??) media-libs/freetype -infinality kpathsea -lcdfilter # kpathsea for texlive; -lcdfilter for cairo (2012-09-03); -infinality for Gnome 3.4 upgrade clean-up media-libs/fontconfig cleartype -lcdfilter # -lcdfilter for these required by world update via some deps (2012-07-23); cleartype added 2012-09-03 via cairo dep media-libs/libpng apng # unofficial animated PNG support for ff 4.0.1 media-libs/libtheora encode media-libs/mesa -gallium -g3dvl -llvm -xorg -xvmc -xa gbm -gles1 -gles2 video_cards_i965

  1. media-libs/x264 -10bit

media-plugins/alsa-plugins pulseaudio media-plugins/audacious-plugins -ffmpeg media-sound/audacity id3tag vamp media-sound/rhythmbox -cdr -gnome-keyring -lastfm media-video/avidemux -amr -qt4

  1. avx for Core i5/i7:

media-video/ffmpeg aacplus amr avx celt gsm faac network vaapi vdpau vpx media-video/libav amr celt gsm faac vpx media-video/mkvtoolnix -qt4 -wxwidgets media-video/mplayer amr openal pvr vaapi vdpau win32codecs media-video/projectx java6

  1. media-video/x264-encoder -10bit

net-analyzer/vnstat gd net-dns/dnsmasq -nls net-im/empathy -geocode # Gnome 3.4 upgrade related net-im/pidgin -gstreamer gnutls net-im/skype qt-static net-libs/gtk-vnc gtk3 net-libs/xulrunner java -networkmanager net-misc/openssh -ldap net-nds/openldap sasl # required on world update: cxx? ( sasl ) sci-visualization/gnuplot -pdf plotutils sys-apps/hal -crypt sys-apps/gnome-disk-utility fat sys-block/parted device-mapper sys-devel/gcc -gtk sys-devel/gettext cvs git # avoid recompile by world updgrade (2012-09-03) sys-fs/udev extras x11-base/xorg-server -hal x11-drivers/xf86-video-intel sna x11-libs/cairo cleartype directfb -lcdfilter x11-libs/libdrm libkms video_cards_intel

dev-db/sqlite fts3 secure-delete # required by firefox-3.6 www-client/firefox java -networkmanager

cross-msp430-unknown-elf-gnu/binutils -selinux cross-msp430/msp430-gdb dev-embedded msp430-gdb cross-msp430/insight dev-util insight cross-msp430/msp430-binutils -selinux -multilib cross-msp430/msp430mcu -selinux -multilib cross-msp430/msp430-libc -selinux -multilib cross-msp430/msp430-gcc -fortran -openmp -selinux -boundschecking -d -gtk -gcj -libffi -mudflap -objc -objc++ -objc-gc -multilib

cross-avr/avr-libc multilib -selinux cross-avr/binutils multilib -selinux cross-avr/gcc multilib -openmp -fortran -selinux -boundschecking -d -gtk -gcj -libffi -mudflap -objc -objc++ -objc-gc cross-avr/gdb sys-devel gdb cross-avr/insight dev-util insight

/etc/portage/package.unmask:

  1. dev-embedded/openocd

sci-electronics/kicad

x11-drivers/xf86-video-intel x11-libs/libdrm

  1. x11-drivers/xf86-video-ati
  2. x11-drivers/xf86-video-nouveau

=x11-proto/glproto-9999

  1. x11-proto/xf86driproto #for mesa 2012-04-09

media-libs/mesa

USE-flagit yms tärkeät muutokset /etc/make.conf:ssa: LINGUAS="en_GB" SANE_BACKENDS="niash"

CAMERAS="canon ptp2" INPUT_DEVICES="keyboard mouse evdev" VIDEO_CARDS="i965 intel vesa"

RUBY_TARGETS="ruby18" # to limit the dependencies for mkvtoolnix

USE=" -arts -cups -eds -hal -java -javascript\ -kde -libwww -musepack -networkmanager -php -qt -samba -xmlrpc\ X a52 aac acpi alsa\ avi bluetooth bzip2 cairo consolekit dbus dga dirac dvb\ exif faac fam ffmpeg firefox flac gif gimpprint gnome\ gnome-keyring gnutls gphoto2 gtk gtk2\ gstreamer jpeg jpeg2k imagemagick imlib introspection lame lcms libnotify\ lm_sensors mad\ matroska mmx mmxext mp3 mpeg msn nautilus nls nptl ogg\ oggvorbis opengl pdf png policykit pulseaudio qt3support\ scanner schroedinger sdl\ speex spell sse sse2 sse3 ssse3 sse4_1\ svg tagwriting theora threads tiff truetype unicode usb v4l\ v4l2 vorbis vpx win32codecs x264 xinerama xv xvmc xvid"


ACCEPT_LICENSE="dlj-1.1 Oracle-BCLA-JavaSE cadsoft RTCW-ETEULA skype-eula AdobeFlash-10.3"

CHOST="x86_64-pc-linux-gnu"

CFLAGS="-march=native -O2 -pipe" CXXFLAGS="${CFLAGS}"

ACCEPT_KEYWORDS="~amd64"

PORTDIR_OVERLAY=/usr/local/portage

FETCHCOMMAND="/usr/bin/wget -t 5 -T 60 -nv --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 -nv --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""

SYNC="git://github.com/funtoo/ports-2012.git"

MAKEOPTS="-j5"

FEATURES="ccache mini-manifest sandbox"

CCACHE_SIZE="1G"

PORTAGE_ELOG_CLASSES="warn error log info qa"

PORTAGE_ELOG_SYSTEM="save"

source /var/lib/layman/make.conf

/var/lib/portage/world:

app-admin/conky app-admin/gkrellm app-admin/pwgen app-admin/sudo app-admin/syslog-ng app-arch/p7zip app-crypt/mcrypt app-editors/gvim app-editors/hexcurse app-misc/screen app-misc/uptimed app-portage/eix app-portage/genlop app-portage/gentoolkit app-portage/layman app-text/texlive-core cross-msp430/msp430-binutils cross-msp430/msp430-gcc cross-msp430/msp430-libc cross-msp430/msp430mcu dev-embedded/avrdude dev-embedded/openocd dev-java/sun-jdk dev-python/gnome-keyring-python dev-texlive/texlive-langenglish dev-texlive/texlive-langfinnish dev-texlive/texlive-latex dev-util/valgrind dev-util/xdelta dev-vcs/git dev-vcs/gitg gnome-base/gnome gnome-extra/nautilus-dropbox mail-client/mail-notification media-fonts/corefonts media-fonts/freefonts media-fonts/ttf-bitstream-vera media-gfx/gimp media-gfx/gqview media-gfx/gthumb media-gfx/imagemagick media-gfx/inkscape media-libs/libgphoto2 media-libs/libtxc_dxtn media-libs/mesa media-libs/x264 media-sound/alsa-utils media-sound/audacious media-sound/audacity media-sound/mumble media-sound/paprefs media-sound/pavucontrol media-sound/pavumeter media-sound/rhythmbox media-sound/vorbis-tools media-tv/linuxtv-dvb-apps media-video/ffmpeg media-video/mplayer media-video/pitivi media-video/projectx media-video/x264-encoder net-analyzer/vnstat net-dns/dnsmasq net-irc/irssi net-misc/bridge-utils net-misc/dhcpcd net-misc/ntp net-misc/youtube-dl net-p2p/linuxdcpp sys-apps/gptfdisk sys-apps/hdparm sys-apps/pciutils sys-apps/portage sys-apps/smartmontools sys-block/scsiadd sys-boot/grub-legacy sys-devel/bc sys-fs/lsscsi sys-fs/reiserfsprogs sys-process/vixie-cron virtual/ffmpeg www-client/firefox www-plugins/adobe-flash www-servers/lighttpd x11-base/xorg-x11 x11-drivers/xf86-video-intel x11-libs/libdrm x11-plugins/pidgin-libnotify x11-terms/gnome-terminal x11-terms/xterm x11-wm/fluxbox