Are you over 18 and want to see adult content?
More Annotations
Chase Careers | So You Can | Find Your Career at Chase | Careers at Chase
Are you over 18 and want to see adult content?
Webb-TV.nu – Störst på gratis svensk play | Streama online
Are you over 18 and want to see adult content?
Genetic Genie | Methylation and detox analysis from 23andMe results
Are you over 18 and want to see adult content?
The Industry's Most Advanced Data-Driven Marketing | Epsilon
Are you over 18 and want to see adult content?
Интернет-магазин одежды оптом, купить одежду дешево в Москве
Are you over 18 and want to see adult content?
Crowdlinker | Leading Digital Product & Transformation Studio
Are you over 18 and want to see adult content?
MediaQuelle.at - Onlineshop fuer alle Filme auf DVD, Blu-ray, Spiele, uncut
Are you over 18 and want to see adult content?
Bienes Raices en Ecuador. Venta y alquiler / renta de casas, departamentos, suites, terrenos, oficinas, locales.
Are you over 18 and want to see adult content?
Favourite Annotations
A complete backup of disabledfeminists.com
Are you over 18 and want to see adult content?
A complete backup of airfieldresearchgroup.org.uk
Are you over 18 and want to see adult content?
Text
RUI'S BLOG
PROGRAMING AND SYSADMIN IN LINUX AND BSDMENU
* About
Search for:
“PEOPLE GOT OO ALL WRONG, ITS NOT ABOUT CLASSES OR OBJECTS. THE BIG IDEA IS MESSAGING” (FROM ALLEN KAY) > Just a gentle reminder that I took some pains at the last OOPSLA to > try to remind everyone that Smalltalk is not only NOT its syntax or > the class library, it is not even about classes. I’m sorry that I > long ago coined the term “objects” for this topic because it > gets many people to focus on the lesser idea.>
> The big idea is “messaging” — that is what the kernal of > Smalltalk/Squeak is all about (and it’s something that was never > quite completed in our > Xerox PARC phase). from Kay, Allen. “prototypes vs classes was: Re: Sun’s HotSpot” Kay is one of the fathers of the idea of object-oriented programming, inventor of Smalltalk.
Advertisements
Report this ad
Advertisements
Report this ad Posted in Uncategorizedand tagged
csp , erlang
, oo
, programming
, smalltalk
on April 30, 2015
by Rui Coelho .
Leave a comment
HOW TO NAVIGATE/BROWSE SHELL HISTORY IN LINUX (USING HSTR/HH) hstr@github is a ncurses used to view, navigate, select and search command history from bashand zsh
.
Its an improved _history|grep_ or _ctrl-r_.1
2
3
4
5
6
$ wget
https://github.com/dvorka/hstr/releases/download/1.16/hh-1.16-bin-64b.tgz-O - | tar -xz
# ncurses list of history filtered by PATTERN$ hh PATTERN
# use options
$ HH_CONFIG=hicolor,regexp hh from hstr: history the easy way Posted in Uncategorizedand tagged
history , linux
, ncurses
, shell
on April 26, 2015
by Rui Coelho .
Leave a comment
HOW TO MONITORING/SHOW THE PROGRESS OF CLI TOOLS IN LINUX (USING CVAND PV)
cv/coreutils viewer@github supports all basic utilities in coreutils package . It is written in C and shows the progress as percentage. Works by scanning _/proc_ for commands that it supports, checks directories _fd_ and _fdinfo_ for opened files and seek positions and finally reports the progress forthe largest file.
1
2
3
4
5
6
7
8
9
10
11
12
$ apt-get|yum|yaourt cv '-m,--monitor' loop while monitored processes are still running '-w,--wait' estimate I/O throughput and ETA '-c,--command command' monitor only this command # see all current and upcoming coreutils commands$ watch cv -q
# see downloads progress $ watch cv -wc firefox # launch and monitor any heavy command using '$!' $ cp bigfile newfile & cv -mp $! from cv: progress bar for cp, mv, rm, dd… pv/pipe viewer /pv@man is a terminal-based tool for monitoring the progress of data through a pipeline.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ apt-get|yum|pacman install pv command1 | pv | command2 pv input.file | command1 | pv > output.file# display options
'-p,--progress/-t,--timer/-e,--eta/-b,--byte' show progress/timer/ETA/bytes# output modifiers
'-N,--name NAME' prefix the output information '-c,--cursor' use cursor positioning escape sequences '-l,--line-mode' instead of counting bytes, count lines '-s,--size SIZE' assume the total amount of data to be transferred isSIZE
# data transfer modifiers '-L,--rate-limit RATE' limite transfer rate by bytes/sec '-B,--buffer-size BYTES' # watch how quickly a file is transferred using nc $ pv file | nc -w 1 host 3000 # see progress of both pipes $ pv -cN rawlogfile file.log | gzip | pv -cN gziplogfile > file.log.gz # with ncurses's dialog $ (pv -n backup.tar.gz | tar xzf - -C path/to/data ) 2>&1 | dialog --gauge "Running tar, please wait..." 10 70 0# rsync and pv
$ rsync options source dest | pv -lpes Number-Of-Filesfrom pv@nixcraft
and rsync and pv@nixcraft Posted in Uncategorizedand tagged
cli , linux
, progress
, sysadmin
on April 22, 2015
by Rui Coelho .
Leave a comment
HOW TO LOCK YOUR LINUX TERMINAL (USING VLOCK AND PHYSLOCK) vlock is a program to lock one or more sessions on the Linux console. This is especially useful for Linux machines which have multiple users with access to the console. One user may lock his or her session(s) while still allowing other users to use the system on other virtual consoles.1
2
3
4
5
6
7
8
9
10
11
12
13
14
$(el) yum install kbd $(deb) apt-get install $(arch) pacman -Sy kdb '-c,--current' lock only this virtual console, allowing user to switch to other virtual consoles '-a,--all' lock all virtual consoles by preventing other users from switching virtual consoles '-n,--new' switch to a new virtual console before locking all console sessions, needs to be compiled with plugin # lock current console$ vlock
# lock all consoles (including virtual console); must run from virtualconsole
$ vlock -a
# lock whole system, switches to a virtual console and then locks as'vlock -a'
$ sudo vlock -n
from vlock: lock your terminal (or system) physlock@github lightweight alternative to vlock, equivalent to `vlock -an’. It is written because vlock blocks some linux kernel mechanisms like hibernate and suspend and can therefore only be used with some limitations.1
2
3
4
5
6
7
8
9
$ git clone https://github.com/muennich/physlock $ cd physlock ; make ; sudo make install '-d' fork and detach, useful for suspend/hibernate scripts '-l' only lock console switching '-L' only enable console switching '-u USER' allow the given user to unlock the computer $ /usr/local/bin/physlock Posted in Uncategorizedand tagged
console , linux
, lock
on April 19, 2015
by Rui Coelho .
Leave a comment
USING PACAPT UNIVERSAL PACKAGE MANAGER (PACMAN FOR ALL) pacapt is a shell script that wraps native package managers in a pacman@arch syntax. Intended for Arch users having to temporarily deal with another distribution. It supports pacman by arch, dpkg/apt-get by
debian/ubuntu , homebrew by OSX , yum/rpm by redhat/centos/fedora, portage by gentoo
, zypper by opensuse, pkgng by freebsd
, pkg_tools by openbsd . See pacman_rosetta@arch1
2
3
4
5
6
7
8
9
10
11
12
## install
$ wget -O /usr/local/bin/pacapt https://github.com/icy/pacapt/raw/ng/pacapt $ chmod 755 /usr/local/bin/pacapt '-Q' list packages installed '-Qq FILE' query which package provides file '-Ql PACKAGE' list package files '-S PACKAGE' install package '-Ss PACKAGE' search package '-Suy' upgrade system and package db '-R PACKAGE' remove package '-Scc' delete all downloaded packages Posted in Uncategorizedand tagged
linux , packages
, pacman
on April 17, 2015
by Rui Coelho .
Leave a comment
HOW TO REMOTE SYSLOG IN LINUX (USING RSYSLOG) rsyslog is an open-source implementation of syslog protocol / rfc3164 and extends it with content-based filtering, rich filtering capabilities, flexible configuration options and adds features such as using TCP for transport. Its used prior to migration to systemd-journald.
> * Facility level is type of processes to monitor: _auth_, _cron_, > _daemon_, _kernel_, _local0..local7_ > * Severity/Priority level is type of log message: _emerg/0_, > alert/1_, _crit/2_, _err/3_, _warn/4_, _notice/5_, _info/6_,> _debug/7_
> * Destination is either local file or remote rsyslog server> _@ip:port_
As a rsyslog client it can filter and sends internal log messages to either local file system or a remote rsyslog server. As rsyslog server it collects logs from other hosts and sends them into internal log messages. See syslogserver@windows .1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$ yum install rsyslog | apt-get install rsyslog | pacman -S rsyslog ##(server) enable listener $(host1) vi /etc/rsyslog.conf# udp
$ModLoad imudp
$UDPServerRun 514
# tcp (slower but more reliable)$ModLoad imtcp
$InputTCPServerRun 514 ##(server) create template to log to filesystem # see http://linux.die.net/man/5/rsyslog.conf $(host1) vi /etc/rsyslog.d/remote_host # log everything to 'host/progname.log' $template RemoteLogs,"/var/log/%HOSTNAME%/%PROGRAMNAME%.log" * # format it '. ?RemoteLogs'*.* ?RemoteLogs
# stop processing messages& ~
# same but using ip
$ vi /etc/rsyslog.d/remote_ip $template IpTemplate,"/var/log/%FROMHOST-IP%.log"*.* ?IpTemplate
& ~
##(client) route all messages to remote server $(host2) vi /etc/rsyslog.d/route_all*.* @host1:514
# same but using tcp instead#*.* @@host1:514
# same but only for some kernel facility kern.* @192.168.1.25:514 $(both) service rsyslog restart | systemctl restart rsyslog from rsyslog server@xmoduloand rsyslog
client@xmodulo
syslog(3) is the syscall used to send messages to system logger. There are wrappers in all languages,including shells
1
2
3
4
5
6
7
8
9
## from shell
# see http://linux.die.net/man/1/logger $ logger -p local0.info -t PROGNAME MESSAGE ## forward journald to local syslog daemon# see
http://www.freedesktop.org/software/systemd/man/journald.conf.html $ vi {/etc,/run,/usr/lib}/systemd/journald.conf.d/*.conf ForwardToSyslog=True # same as kernel command line option 'systemd.journald.forward_to_syslog=True' Posted in Uncategorizedand tagged
journald , linux
, sysadmin
, syslog
on April 16, 2015
by Rui Coelho .
Leave a comment
HOW TO USB FLASH A BOOTABLE LINUX INSTALLATION MEDIA (USING DD/DDRESCUE AND TESTDRIVE)dd@man /dd@wiki
is a command-line utility for Unix and Unix-like operating systems whose primary purpose is to convert and copy files.1
2
3
4
5
6
7
8
9
$ yum|apt-get|pacman coreutils# find device name
$ lsblk
# unmount it
$ sudo umount /dev/sdx # write/data transfer $ sudo dd bs=4M if=/path/to/linux.iso of=/dev/sdx && syncfrom usb flash@arch
gnu ddrescue@man combines both dd_rescue’s ability to read big blocks and then shift gears, with dd_rhelp’s ability to remember what parts of the disk have been looked at already. It’s written in C++ and it’s small and fast.1
2
3
4
5
6
7
8
$(deb) apt-get install gddrescue $(el) yum install ddrescue $(arch) pacman -Su ddrescue '-d,--direct' direct disc access for input file '-D,--synchronous' use synchronous writes for output file $ sudo ddrescue -d -D --force /path/to/linux.iso /dev/sdx from disk drive recovery: ddrescue, dd_rescue, dd_rhelptestdisk@arch
can be used to recover if you dd/ddrescue to the wrong device Posted in Uncategorizedand tagged
dd , flash
, linux
, recover
, usb
on April 14, 2015
by Rui Coelho .
Leave a comment
HOW TO WRITE A LINUX KERNEL MODULEKernel modules
are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## obtaining information # list loaded modules$ lsmod
# show module info
$ modinfo MODULENAME# list dependencies
$ modprobe --show-depends MODULENAME ## automatic module load # configure udev/systemd-modules to what modules to load at boot, see 'man modules-load.d' $ vi {/etc,/run,/usr/lib}/modules-load.d/PROGRAM.confMODULENAME
## manual module load# load by name
$ modprobe MODULENAME # load by filename from '/lib/modules/$(uname -r)/'$ insmod FILENAME
# unload module
$ modprobe -r MODULENAME# same
$ rmmod MODULENAME
## passing parameters to module # either from '/etc/modprobe.d' $ vi /etc/modprobe.d/FILENAME.conf options MODULENAME parametername=parametervalue # or from kernel command line MODULENAME.parametername=parametercontents ## blacklisting: prevent the kernel module from loading # either from '/etc/modprobe.d' $ vi /etc/modprobe.d/FILENAME.conf blacklist MODULENAME # or from kernel command line modprobe.blacklist=modname1,modname2,modname3 from kernel modules@arch You can write your own modules, see the linux kernel moduleprogramming guide .
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# install build dependencies (kernel source) $(deb) apt-get install build-essential linux-headers-$(uname -r) $(el) yum install yum install gcc gcc-c++ make kernel-headers $(arch) pacman -Syu base-devel linux-headers # write a hello world module$ vi hello.c
#include}
static void __exit hello_cleanup(void) { printk(KERN_NOTICE "Cleaning up module.n");}
module_init(hello_init); module_exit(hello_cleanup);$ Makefile
obj-m += hello.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modulesclean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean# testing
$ make ; sudo insmod hello.ko $ dmesg|grep -i hello $ sudo rmmod hello.koReport this ad
from how to write your own linux kernel module Posted in Uncategorizedand tagged
kernel , linux
, module
, programming
on April 13, 2015
by Rui Coelho .
Leave a comment
USING HOMEBREW AND CASK PACKAGE MANAGERS IN OSX Homebrew is a package management system for OSX. It installs packages in its own _cellar_ directory and symblinkes to _/usr/local_. Homebrew terminology: _Formula_ is the package definition, _keg_ is formula installation prefix, _cellar_ is where all kegs are installed, _tap_ is optional formula repositories, _bottle_ is pre-built binary keg that can be unpacked.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## install
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"$ brew --version
## using
# update formulas
$ brew update
# install/uninstall/upgrade/info/search packages $ brew install|uninstall|upgrade|info|search "package"# list installed
$ brew list
## contributing
# forked https://github.com/Homebrew/homebrew and clone $ git clone https://github.com/Details
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0