Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
steveL's favourite tips
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2717
Location: The Peanut Gallery

PostPosted: Mon Jun 23, 2014 2:03 am    Post subject: command output Reply with quote

Code:
lspci -k | less
to view in a pager.
Code:
lspci -k > ~/lspci.out
to save to a file in homedir.
Code:
lspci -k | wgetpaste -r
to get a pastebin url others can look at, usually on IRC.

I prefer sprunge for pasting, though you need curl installed to use it quickly from the command-line, and wget comes in the stage. Still, sh is quick :)

You put this function in: ~/.bashrc then: sprunge *.c or: cmd.. | sprunge
Code:
sprunge() {
   if [ $# -eq 0 ] || { [ $# -eq 1 ] && [ x- = "x$1" ]; }; then
      curl -F 'sprunge=<-' http://sprunge.us
   else
      local f
      for f; do
         [ -f "$f" ] || continue
         echo "Paste of: $f"
         curl -F 'sprunge=<-' http://sprunge.us < "$f"
      done
   fi
}

It's written to be POSIX sh-compatible, hence the use of [ instead of [[
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2717
Location: The Peanut Gallery

PostPosted: Sun Jun 29, 2014 3:17 am    Post subject: Switching to eudev Reply with quote

Nice little howto from Tractor Girl (as usual quoting directly):

Udev is part of systemd. For now it can be used separately without systemd but its current situation is somewhat blurry and causes constant confusion and problems.
To handle that, gentoo devs created a udev fork: eudev. Eudev is and will be completely independent from systemd.
So if you don't need/want to use systemd and don't want to be bother with crazy stuff on every udev update, you should switch to eudev:
Code:
# to keep sane net-names:
echo 'sys-fs/eudev -rule-generator' >> /etc/portage/package.use
emerge -avC udev
emerge -av eudev
dispatch-conf # or etc-update etc.
/etc/init.d/udev --nodeps restart
# if you use insane net-names, eg during transition, run this:
# rc-update add udev-postmount default

optionally:
Code:
emerge -av @preserved-rebuild

==
You may need to remove virtual/udev after removing sys-fs/udev, as "program666" mentioned in the next post ("This fixed everything." ;)

For that I'd use:
Code:
emerge -cq virtual/udev
since other apps will depend on it in the tree. (You may well not need to, since the upgrade path is supposed to be working now.)

If you get the error: You're missing a /dev/fd symlink to /proc/self/fd when emerging eudev, then run:
Code:
ln -sf /proc/self/fd /dev/fd

Don't worry nothing will be broken so long as you don't reboot or crash in-between removing udev and emerging eudev. The virtual will be reinstalled as soon as you emerge something that needs it (world will do); it'll be satisfied by eudev.

Don't forget to run dispatch-conf (or w/e you use to etc-update.) I've put it in immediately after above, but you may need to run it after restart (I haven't switched yet. Will do soon:) Just be sure you've checked it to your satisfaction, before reboot.

edit: /dev/fd symlink to /proc/self/fd; run dispatch-conf after installing eudev, explanation.
USE: -rule-generator, no need for postmount


Last edited by steveL on Thu Oct 23, 2014 12:35 am; edited 6 times in total
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4222

PostPosted: Sun Jun 29, 2014 9:11 am    Post subject: Re: Switching to eudev Reply with quote

steveL wrote:
The virtual will be reinstalled as soon as you emerge something; it'll be satisfied by eudev.

Although most gentoo users will know, one should perhaps point out that you do not have to worry if the virtual is not reinstalled. There are many reason why this might not happen (e.g.: nothing depends on it, the emerged package does not depend on it, etc.) Nothing bad happens if a virtual is not installed.
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2717
Location: The Peanut Gallery

PostPosted: Tue Jul 22, 2014 4:04 pm    Post subject: Using git from cli Reply with quote

Just my git setup, in case I need to recover it sometime.

I use the command-line (F12 for yakuake which rocks) for most things, and kdiff3 as my git difftool. Normally I view the history with gitview, especially before I push as it shows it in a different context. I'm lazy so I do this via sh aliases instead of git ones (these are from my ~/.bashrc file):
Code:
alias status='git status'
alias branch='git branch'
alias vbranch='git branch -lvv'
alias co='git checkout'
alias add='git add'
alias unadd='git reset HEAD'
alias gdiff='git diff'
alias staged='git diff --staged'
alias vdiff='git difftool -y'
alias vstaged='git difftool -y --staged'
alias ddiff='git difftool -d --no-symlinks'
alias commit='git commit'
alias merge='git merge --ff-only'
alias pull='git remote update -p; git merge --ff-only @{u}'
alias lol='git log --oneline --graph --decorate --all'
alias view='gitview --all 2>/dev/null &'

and this is my ~/.gitconfig; I'm including it all (apart from [user]) as the colour stuff and ps viewer is useful, and you might get some ideas for other things. Really you just need to run
Code:
git config --global diff.tool kdiff3
to make the aliases using git difftool above work. You very likely don't want pack.threads setting: I find it useful as I'm on an old core2-duo.
Code:
[core]
   excludesfile = $HOME/.gitignore
   abbrev = 12

[pack]
   threads = 0

[diff]
   tool = kdiff3

[difftool]
#   prompt = 0

#   default = current - push to same name, upstream @{u}, simple @{u} if same name, never
# simple is new default in 2.0; 1.x+ was: matching = all branches with same name
[push]
   default = simple

# only allow linear pull (= fetch + merge.)
# NOTE merge of branches (ie: annotated tags) normally:
# default: ff = true   # attempt to ff, merge if not, ie:
#  git merge --no-ff   # fork.
# manual setting forces reflection.
[merge]
   ff = only

[branch]
# track (git pull merges from starting branch) if branching from:
# true = remote, always = local + remote, false
# writes: merge = refs/heads/foo  for branch: foo
   autosetupmerge = false
# use: git push --set-upstream origin foobar 

# rebase when merging, from remote (= .  for local) ie upstream
# if tracking: branch -t local, git clone/fetch new remote
# never, local, remote, always
   autosetuprebase = local

# for local tracking branches, to push back to server:
# git config branch.foo.pushremote origin

[rerere]
   enabled = true # store resolved rebase steps even when aborted

[alias]
   unadd = reset HEAD
   up = "!git remote update -p; git merge --ff-only @{u}"

# show postscript diffs via util, mark as binary
# http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
[diff "ps"]
   textconv = ps2ascii
   binary = true

# see https://github.com/grosser/dotfiles/blob/master/gitconfig
[color]
   ui = auto
   branch = auto
   diff = auto
   status = auto

[color "branch"]
   current = green
   local = blue
   remote = yellow

#normal status has added/changed = green untracked/deleted/conflic = red -> more colors
[color "status"]
   added = green
   changed = yellow
   untracked = cyan

[color "diff"]
   whitespace = cyan

[pager]
   color = true

Also, you likely don't want the branch stuff, but I quite like forcing merges to ff-only, as it means by default everything is linear, and true merges only happen when I explicitly git merge --no-ff (which I haven't had to do yet, as it's only small-team projects.) It's important for pulls, which are defined as fetch followed by merge; hence the git up alias from the web, which I just run directly via pull in terminal. The lol (log one-liner) alias is handy too; I got it from someone in the #git channel on IRC chat.freenode.net, which I highly recommend.

Similarly, the abbrev = 12 set with
Code:
git config --global core.abbrev 12
I find useful for pushing specific commits, selected from the branch history in lol, eg:
Code:
git push origin $SHA_ID:master
In such cases I feel more confident with more hex digits.

kdiff3 works really well; typically I just use vdiff somefile to review what I've been working on before, which shows me the whole file, instead of the standard coloured diff in terminal, which I use more before committing stuff I've just written. git diff --staged (staged or vstaged alias) really helps to review the commit before you move on to the next one; you can still tweak it after view, and commit --amend.

Also, I always use add -p to make better commits, in preference to rebasing after the event, which i find trickier to reason about; and anyway I'd like to avoid rebasing as a work habit. There's no real benefit to spending time editing, moving and squashing commits to "package" feature changes ime. Just do those on a separate rebased branch if it matters, and use the vcs to record your actual workflow, as it's about the work and the results, not presentation of a manufactured history. Smaller commits may be interrelated, with other commits in-between, but because they're smaller, they're easier to review, if someone really does care.

And if not, whom are we packaging it for anyway? Posterity? lul. They're more likely to be looking at the actual code, and git blame if it matters, and from what I've read people tend to be more interested in how code was actually written, when looking historically; which let's face it, isn't going to be a factor for most of our code. ;)

edit: git config --global


Last edited by steveL on Wed Oct 22, 2014 10:46 am; edited 1 time in total
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2717
Location: The Peanut Gallery

PostPosted: Mon Sep 08, 2014 11:57 pm    Post subject: vmlinuz and initrd.img Reply with quote

A user in #gentoo, coming from another OS, wanted to know: where the vmlinuz and initrd.img files on a Gentoo minimal install .iso (amd64) are:
iamben wrote:
in isolinux/gentoo (kernel) and isolinux/gentoo.igz (initramfs)
See isolinux.cfg for what kernel parameters are passed.

Latter is in reference to "Could not find the root block device in ." during boot.

May seem obvious, but could help someone down the road; iamben is always on the ball, ofc.
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2717
Location: The Peanut Gallery

PostPosted: Thu Sep 18, 2014 1:49 pm    Post subject: vm.swappiness Reply with quote

Great tip from Yamakuzure (direct quoting, as usual):

Code:
$ grep -A 1 -B 1 vm.swap /etc/sysctl.conf
# Reduce swappiness from server like 60 to 32GB RAM notebook 0
vm.swappiness=0
vm.vfs_cache_pressure=50

Note: swappiness=0 does not mean that swap is disabled.
A value of 0 instructs the kernel not to initiate swap until the amount of free and file-backed pages is less than the high water mark in a zone.

Current memory state:
Code:
$ free -m
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2717
Location: The Peanut Gallery

PostPosted: Wed Sep 24, 2014 5:53 pm    Post subject: Switching to MATE Reply with quote

Gnome3 crapfest getting you down? Tired of trying to keep it off your machine and still retain some semblance of a Unix? Fed up of an interface that is nowhere near as useful as Gnome2?

Tony0945 writes:
If you search the forum, you will find several threads on converting to Mate with masks posted. I participated in several of those threads, but on the final machine that I converted, I just removed all the gnome use flags, changed profile from Gnome to plain Desktop (very important), emerge'd -C anything from gnome, --depclean, then unmasked and emerge'd Mate which brought several things back. I don't know if I can really recommend that approach, but it was simple. If you have a lot of customization in Gnome, I'd look for more expert advice than mine.

If you don't need remote login, I recommend SLiM, http://wiki.gentoo.org/wiki/SLiM. That will give you the chance to choose your desktop at each login.

Personally, I've gone back to vanilla XDM as I run only Mate now and sometimes do remote login with XDMCP.
==
wrt "expert advice": try #gentoo and #gentoo-desktop as well as #mate on IRC: chat.freenode.net (in addition to the forums.)
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 2586

PostPosted: Wed Sep 24, 2014 7:28 pm    Post subject: Re: Switching to MATE Reply with quote

steveL wrote:

Personally, I've gone back to vanilla XDM as I run only Mate now and sometimes do remote login with XDMCP.


I'm still using some carefully masked GNOME libraries, because...

gnucash pulls in some GNOME bits'n'pieces.
I like gthumb for my photos, as does my wife.
I currently need gdm:
1 - It does autologin for my wife on her machine, making it appliance-like for a better W.A.F.
2 - It manages to allow remote X connections - too many display managers imply "-nolisten tcp" with no easy way to change.
3 - On occasion I actually do use XDCMP.
4 - I like reboot/shutdown controls on the login screen.

From what I can tell, gdm is the only one that does all 4 - I'd be happy to have something else and get rid of as much GNOME as I can. I have in the past had a tk hack that added reboot/shutdown buttons to xdm, but lost them somewhere along the way, nor am I sure how to do XDCMP with xdm.

If you've got a tip for this, I'm all ears.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2717
Location: The Peanut Gallery

PostPosted: Sat Sep 27, 2014 7:02 pm    Post subject: Reply with quote

@depontius: I don't use GNOME so can't advise; was hoping tony0945 might respond. I recommend starting a new topic for it in Desktop Environments.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum