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: 2516
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: 2516
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:
emerge -avC udev
emerge -av eudev
/etc/init.d/udev --nodeps restart
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.

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; it'll be satisfied by eudev.

Don't forget to run dispatch-conf (or w/e you use to etc-update.)
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4125

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: 2516
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 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

[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.

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. ;)
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2516
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: 2516
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
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