CASA ȘTIINȚEI
CASA ȘTIINȚEI este locul unde diverse subiecte sunt dezbătute și scrise.
|
Lista Forumurilor Pe Tematici
|
CASA ȘTIINȚEI | Inregistrare | Login
POZE CASA ȘTIINȚEI
Nu sunteti logat.
|
Nou pe simpatie: crazygirl pe Simpatie.ro
 | Femeie 23 ani Buzau cauta Barbat 26 - 80 ani |
|
blurex
Învățăcel
 Inregistrat: acum 8 ani
Postari: 97
|
|
cd / (root) cd ~ (user folder) ls -d */ (listeaza doar folderele) find . -name "nume.exe" -maxdepth 1 -type d (include in comanda find fisierele ascunse, punctul inseamna current directory) find . | grep file.exe (afiseaza tot ce e in current dir si selecteaza fisierul)
ls --l or ls -m sudo find -iname XXX (You can use Wild Cards) -iname arguement is to make the search case insensitive sudo mkdir folder sudo rm folder (sudo rm folder --r for directory and trees) sudo mv file/folder -- moves/ renames sudo cp souce destination- copy (add --r for directories)
apropos cuvant (cauta in numele si descrierea paginilor de manual) man cmus /cuvant n sau /cuvant shift+n (cauta cuvantul in manualul lui cmus si apesi pe n ca sa navighezi) du -sh (afla dimensiunea unui folder; -s summarize, -h human-readable, -c produce grand total)
xdg-open file.pdf (deschide fisier .pdf spre ex cu aplicatia default pentru acel gen)
Mounting Dives Basic Process = Create Directory -- List Attached Drives -- Link Directory to Drive sudo mkdir /mnt/folder (Create folder in /mnt directory for easier administration) sudo fdisk --l (trebuie sa fii in cd /) sudo mount drive folder sudo mount /dev/cdrom /folder sudo umount drive Use /mnt/subfolder for exclusions later
sudo chown user file
Modificat de blurex (acum 8 ani)
|
|
pus acum 8 ani |
|
blurex
Învățăcel
 Inregistrat: acum 8 ani
Postari: 97
|
|
vim
a = insert, esc = exit insert ctrl+w = ctrl+backspace :/ = find (use wildcards) :/? = Find backward n = next Exiting and Saving :q = quit :q! = quit no save :wq = save and quit :e = open file :w = save as
vim Cheatsheet
Global
:help keyword - open help for keyword :o file - open file :saveas file - save file as :close - close current pane
Cursor movement
h - move cursor left j - move cursor down k - move cursor up l - move cursor right w - jump forwards to the start of a word W - jump forwards to the start of a word (words can contain punctuation) e - jump forwards to the end of a word E - jump forwards to the end of a word (words can contain punctuation) b - jump backwards to the start of a word B - jump backwards to the start of a word (words can contain punctuation) 0 - jump to the start of the line ^ - jump to the first non-blank character of the line $ - jump to the end of the line g_ - jump to the last non-blank character of the line gg - go to the first line of the document G - go to the last line of the document 5G - go to line 5 fx - jump to next occurrence of character x tx - jump to before next occurrence of character x } - jump to next paragraph (or function/block, when editing code) { - jump to previous paragraph (or function/block, when editing code) Ctrl + b - move back one full screen Ctrl + f - move forward one full screen Ctrl + d - move forward 1/2 a screen Ctrl + u - move back 1/2 a screen
Tip: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines.
Insert mode - inserting/appending text
i - insert before the cursor I - insert at the beginning of the line a - insert (append) after the cursor A - insert (append) at the end of the line o - append (open) a new line below the current line O - append (open) a new line above the current line ea - insert (append) at the end of the word Esc - exit insert mode
Editing
r - replace a single character J - join line below to the current one cc - change (replace) entire line cw - change (replace) to the end of the word c$ - change (replace) to the end of the line s - delete character and substitute text S - delete line and substitute text (same as cc) xp - transpose two letters (delete and paste) u - undo Ctrl + r - redo . - repeat last command
Marking text (visual mode)
v - start visual mode, mark lines, then do a command (like y-yank) V - start linewise visual mode o - move to other end of marked area Ctrl + v - start visual block mode O - move to other corner of block aw - mark a word ab - a block with () aB - a block with {} ib - inner block with () iB - inner block with {} Esc - exit visual mode
Visual commands
> - shift text right < - shift text left y - yank (copy) marked text d - delete marked text ~ - switch case
Registers
:reg - show registers content "xy - yank into register x "0p - paste contents of register x
Tip Registers are being stored in ~/.viminfo, and will be loaded again on next restart of vim.
Tip Register 0 contains always the value of the last yank command.
Marks
:marks - list of marks ma - set current position for mark A `a - jump to position of mark A y`a - yank text to position of mark A
Macros
qa - record macro a qq - stop recording macro @@ - rerun last run macro
Cut and paste
yy - yank (copy) a line 2yy - yank (copy) 2 lines yw - yank (copy) the characters of the word from the cursor position to the start of the next word y$ - yank (copy) to end of line p - put (paste) the clipboard after cursor P - put (paste) before cursor dd - delete (cut) a line 2dd - delete (cut) 2 lines dw - delete (cut) the characters of the word from the cursor position to the start of the next word D - delete (cut) to the end of the line d$ - delete (cut) to the end of the line x - delete (cut) character
Exiting
:w - write (save) the file, but don't exit :w !sudo tee % - write out the current file using sudo :wq or :x or ZZ - write (save) and quit :q - quit (fails if there are unsaved changes) :q! or ZQ - quit and throw away unsaved changes
Search and replace
/pattern - search for pattern ?pattern - search backward for pattern \vpattern - 'very magic' pattern: non-alphanumeric characters are interpreted as special regex symbols (no escaping needed) n - repeat search in same direction N - repeat search in opposite direction :%s/old/new/g - replace all old with new throughout file :%s/old/new/gc - replace all old with new throughout file with confirmations :noh - remove highlighting of search matches
Search in multiple files
:vimgrep /pattern/ {file} - search for pattern in multiple files e.g. :vimgrep /foo/ **/* :cn - jump to the next match :cp - jump to the previous match :copen - open a window containing the list of matches
Working with multiple files
:e filename - edit a file in a new buffer :bnext or :bn - go to the next buffer :bprev or :bp - go to the previous buffer :bd - delete a buffer (close a file) :ls - list all open buffers :sp filename - open a file in a new buffer and split window :vsp filename - open a file in a new buffer and vertically split window Ctrl + ws - split window Ctrl + ww - switch windows Ctrl + wq - quit a window Ctrl + wv - split window vertically Ctrl + wh - move cursor to the left window (vertical split) Ctrl + wl - move cursor to the right window (vertical split) Ctrl + wj - move cursor to the window below (horizontal split) Ctrl + wk - move cursor to the window above (horizontal split)
Tabs
:tabnew filename or :tabn filename - open a file in a new tab Ctrl + wT - move the current split window into its own tab gt or :tabnext or :tabn - move to the next tab gT or :tabprev or :tabp - move to the previous tab #gt - move to tab number # :tabmove # - move current tab to the #th position (indexed from 0) :tabclose or :tabc - close the current tab and all its windows :tabonly or :tabo - close all tabs except for the current one :tabdo command - run the command on all tabs (e.g. :tabdo q - closes all opened tabs)
Modificat de blurex (acum 8 ani)
|
|
pus acum 8 ani |
|
blurex
Învățăcel
 Inregistrat: acum 8 ani
Postari: 97
|
|
tmux (start new) tmux new -s myname (start new with session name) tmux a # (or at, or attach) tmux a -t myname (attach to named) tmux ls (list session) tmux kill-session -t myname (kill session) tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill (kill all the sessions)
=========================================
ctrl + % //split window into two panels horizontally ctrl + " //split window into two panels vertically ctrl + o //scroll through panels ctrl + x //kill current panel ctrl + & //kill current windows ctrl + q //show panel numbers, press number key to go to that panel ctrl + ; //go to last used panel ctrl + l //go to last used window ctrl + z //toggle panel zoom
=========================================
Sessions - CTRL + B
:new<CR> new session s list sessions $ name session
Windows (tabs)
c create window w list windows n next window p previous window f find window , name window & kill window
Panes (splits)
% vertical split " horizontal split
o swap panes q show pane numbers x kill pane + break pane into window (e.g. to select text by mouse to copy) - restore pane from window ⍽ space - toggle between layouts <prefix> q (Show pane numbers, when the numbers show up type the key to goto that pane) <prefix> { (Move the current pane left) <prefix> } (Move the current pane right) <prefix> z toggle pane zoom
Sync Panes
You can do this by switching to the appropriate window, typing your Tmux prefix (commonly Ctrl-B or Ctrl-A) and then a colon to bring up a Tmux command line, and typing:
:setw synchronize-panes
You can optionally add on or off to specify which state you want; otherwise the option is simply toggled. This option is specific to one window, so it won’t change the way your other sessions or windows operate. When you’re done, toggle it off again by repeating the command. tip source Resizing Panes
You can also resize panes if you don’t like the layout defaults. I personally rarely need to do this, though it’s handy to know how. Here is the basic syntax to resize panes:
PREFIX : resize-pane -D (Resizes the current pane down) PREFIX : resize-pane -U (Resizes the current pane upward) PREFIX : resize-pane -L (Resizes the current pane left) PREFIX : resize-pane -R (Resizes the current pane right) PREFIX : resize-pane -D 20 (Resizes the current pane down by 20 cells) PREFIX : resize-pane -U 20 (Resizes the current pane upward by 20 cells) PREFIX : resize-pane -L 20 (Resizes the current pane left by 20 cells) PREFIX : resize-pane -R 20 (Resizes the current pane right by 20 cells) PREFIX : resize-pane -t 2 20 (Resizes the pane with the id of 2 down by 20 cells) PREFIX : resize-pane -t -L 20 (Resizes the pane with the id of 2 left by 20 cells)
Copy mode:
Pressing PREFIX [ places us in Copy mode. We can then use our movement keys to move our cursor around the screen. By default, the arrow keys work. we set our configuration file to use Vim keys for moving between windows and resizing panes so we wouldn’t have to take our hands off the home row. tmux has a vi mode for working with the buffer as well. To enable it, add this line to .tmux.conf:
setw -g mode-keys vi
With this option set, we can use h, j, k, and l to move around our buffer.
To get out of Copy mode, we just press the ENTER key. Moving around one character at a time isn’t very efficient. Since we enabled vi mode, we can also use some other visible shortcuts to move around the buffer.
For example, we can use "w" to jump to the next word and "b" to jump back one word. And we can use "f", followed by any character, to jump to that character on the same line, and "F" to jump backwards on the line.
Function vi emacs Back to indentation ^ M-m Clear selection Escape C-g Copy selection Enter M-w Cursor down j Down Cursor left h Left Cursor right l Right Cursor to bottom line L Cursor to middle line M M-r Cursor to top line H M-R Cursor up k Up Delete entire line d C-u Delete to end of line D C-k End of line $ C-e Goto line : g Half page down C-d M-Down Half page up C-u M-Up Next page C-f Page down Next word w M-f Paste buffer p C-y Previous page C-b Page up Previous word b M-b Quit mode q Escape Scroll down C-Down or J C-Down Scroll up C-Up or K C-Up Search again n n Search backward ? C-r Search forward / C-s Start of line 0 C-a Start selection Space C-Space Transpose chars C-t
Misc
d detach t big clock ? list shortcuts : prompt
Configurations Options:
# Mouse support - set to on if you want to use the mouse * setw -g mode-mouse off * set -g mouse-select-pane off * set -g mouse-resize-pane off * set -g mouse-select-window off
# Set the default terminal mode to 256color mode set -g default-terminal "screen-256color"
# enable activity alerts setw -g monitor-activity on set -g visual-activity on
# Center the window list set -g status-justify centre
# Maximize and restore a pane unbind Up bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp unbind Down bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
Modificat de blurex (acum 8 ani)
|
|
pus acum 8 ani |
|
blurex
Învățăcel
 Inregistrat: acum 8 ani
Postari: 97
|
|
Users
sudo adduser username sudo passwd username sudo userdel username sudo vim /etc/passwd (shows usernames, names of users, home directories)
Groups
Sudo groupadd groupname Sudo groupdel groupname Sudo vim /etc/group (shows groups and users)
Permissions
Numbers = owner/group/everyone else 4 = read, 2 = write, 1 = execute sudo chmod 777 file/folder (-R for recursive)
Changing Ownership
sudo chown -R username file/folder sudo chgrp --R groupname file/folder
|
|
pus acum 8 ani |
|
blurex
Învățăcel
 Inregistrat: acum 8 ani
Postari: 97
|
|
Bell Sound in IRSSI Tutorial:
$ sudo apt-get install vorbis-tools $ cat ~/.xkb/xkbevd.cf soundDirectory="/usr/share/sounds/" soundCmd="ogg123 -q" Bell() "ubuntu/stereo/message-new-instant.ogg"
ogg123 -q /usr/share/sounds/ubuntu/stereo/message-new-instant.ogg
If you want to personnalize the sound, you just have to modify the variables soundDirectory and the one located just after the Bell() in the code ;-)
Finally, I added a startup program to be launched when I connect into my system (I did that really simply, graphicaly in Ubuntu).
For the modifications to be effective without relogging the first time, launch :
xkbevd -bg
|
|
pus acum 8 ani |
|
blurex
Învățăcel
 Inregistrat: acum 8 ani
Postari: 97
|
|
Beep Sound cand este o comanda gata
de adaugat in ~/.bashrc la aliasuri
export BEEP=/usr/share/sounds/ubuntu/stereo/service-login.ogg alias beep='paplay $BEEP & #' (diezul este simbolul de comentariu in bash)
exemplu: find . | grep treasure ; beep (cand gaseste comoara, face sunet)
modificare: alias b="paplay /usr/share/sounds/ubuntu/stereo/service-login.ogg & :"
Modificat de blurex (acum 8 ani)
|
|
pus acum 8 ani |
|
blurex
Învățăcel
 Inregistrat: acum 8 ani
Postari: 97
|
|
cmus (c music player)
switch views with number keys :add foldercumuzica UP DOWN //navighezi LEFT RIGHT //seek +5 SPACE //open folder ENTER //play :clear //se fol dupa iar :add ca sa reimprospatezi folderul C //pauza X //play V //stop Z //previous V //next + //increase volume - //decrease volume :set //repeat_current=true i //go to currently selected
paste from
Introduction cmus is a small, fast and powerful console music player for Unix-like operating systems https://cmus.github.io/ Views 1 Library 2 Sorted library 3 Playlist 4 Play queue 5 Browser 6 Filters 7 Settings Cursor Movement k / ↑ Move up j / ↓ Move down g Jump to top Shift-g Jump to bottom Browser Space / Enter Activate selection Backspace Browser up u Refresh files i Toggle show hidden Add/Remove Tracks a Add track/folder from Browser view e Append track to Queue Shift-e Prepend track to Queue y Add track to Playlist p Moves marked tracks to immediately after the selected track Shift-p Moves marked tracks to immediately before the selected track Shift-d Remove track from current view (1-4) Song Navigation x Play / Restart c Pause / Play v Stop b Next track z Previous track l / → Skip 5s forward h / ← Skip 5s backward . Skip 1m forward , Skip 1m backward Volume = / + +10% - -10% [ +1% / +0 ] +0 / +1% { -1% / -0 } -0 / -1% Mode s Toggle shuffle Shift-c Toggle continue r Toggle repeat ^R Toggle repeat current m Toggle artist/album/all t Toggle show_remaining_time o Toggle play_sorted Exiting q Interactive quit :q Quit
|
|
pus acum 8 ani |
|