Skip to content

Commit

Permalink
Logo.
Browse files Browse the repository at this point in the history
  • Loading branch information
cirosantilli committed Oct 25, 2014
1 parent d75d8ca commit 5d838b9
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 154 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
@@ -1,5 +1,5 @@
#Contributing Guidelines
#Contributing guidelines

Use the following Markdown style: <https://github.com/cirosantilli/markdown-styleguide> W2.

If automatic assertions can be made for the entire file to be run, put it in a `.sh` file. Otherwise, put it on a `.md` file.
If automatic assertions can be made for the entire file to be run, put it in a `.sh` file. Otherwise, put it on a `.md` file.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
#Linux Cheat
# ![logo](logo.jpg) Linux Cheat

Linux information and cheatsheets.

Expand Down
14 changes: 14 additions & 0 deletions etc.md
@@ -0,0 +1,14 @@
#/etc/issue

Contains the message that is printed before login shells (Ubuntu Ctrl + Alt + 1).

See:

man issue

<http://unix.stackexchange.com/questions/84280/is-etc-issue-common-file>

Of course, since this is meant to be shown to end users,
it serves as a broadcast message for CLI only environments,
and should not be used to identify the distribution even though
it usually contains the distribution ID by default.
32 changes: 17 additions & 15 deletions game.md
Expand Up @@ -50,7 +50,7 @@ List games on Ubuntu:

Review top 10: <http://techtinkering.com/2009/08/11/my-top-10-classic-text-mode-bsd-games/>

###adventure games
###Adventure games

Computer RPGs.

Expand Down Expand Up @@ -146,7 +146,7 @@ CLI go.

Conway's game of life simulator

Because the global menu does not work, deactivate it on ubuntu:
Because the global menu does not work, deactivate it on Ubuntu:

env UBUNTU_MENUPROXY=0 golly

Expand All @@ -156,7 +156,7 @@ Minesweeper clone

gnomine

##gnotski
##Gnotski

Knotski clone.

Expand All @@ -170,53 +170,53 @@ Also known as connect four.

Warning: this games has been solved, so the program might do perfect play =)

#kde
#KDE

##kreversi

Reversi for KDE.

#fps

##urban terror
##Urban Terror

CS like, but mostly capture the flag.

Good inertia, not too fast.

Free but closed source.

##world of padman
##World of Padman

FPS, very large scenarios, cool weapons.

Too fast for my taste.

#clones

##pingus
##Pingus

Great lemmings clone.
Lemmings clone.

Includes map designer.

##hedgewars
##Hedgewars

Great worms clone, has same feeling. Includes map builder.
Worms clone, has same feeling. Includes map builder.

##super maryo chronicles
##Super Maryo Chronicles

Super mario bros clone.

##Tux Kart

Mario Kart 64 clone.

#strategy
#Strategy

##battle for wesnoth
##Battle for Wesnoth

Turn based unit control on 2d hexagonal map.
Turn based unit control on 2D hexagonal map.

Very addictive and time consuming.

Expand Down Expand Up @@ -306,7 +306,9 @@ Two versions: GTK or not. Take GTK.

Executable name: `gvba`.

Version 1.8.0 had the too fast bug: <http://askubuntu.com/questions/62611/visual-boy-advanced-emulator-runs-too-fast>. Seems unsolved.
Version 1.8.0 had the too fast bug:
<http://askubuntu.com/questions/62611/visual-boy-advanced-emulator-runs-too-fast>.
Seems unsolved.

###mednafen

Expand Down
82 changes: 45 additions & 37 deletions init.md
Expand Up @@ -70,7 +70,7 @@ Ubuntu install before 14.04:

sudo aptitude install -y chkconfig

Removed in 14.04 and replaced by `sysv-rc-config`.
Removed in 14.04 and replaced by `sysv-rc-conf`.

Show table saying which service is on at which runlevel:

Expand All @@ -87,14 +87,44 @@ Show only for a single service:

##initctl

Same as `sudo service --status-all` but for System V:
Show status of all services:

sudo initctl list

Like `sudo service --status-all` but for System V.

#/etc/init.d

System V scripts, which will be symlinked from the `rc.d` directories.

##/etc/inittab

System V configuration file.

Not used in Upstart.

##Ubuntu specific

`/etc/defaults/name` are shell scripts that contain environment variables which can be used by the corresponding init script. Rationale: scripts can be updated without destroying parameters. File in `defaults` are never changed by the package manager.

##update-rc.d

CLI tool that manages System V symlinks between `/etc/rcX` and `/etc/init.d`.

Prevent a service from starting at startup (removes the symlink):

sudo update-rc.d apache2 disable

Enable a service:

sudo update-rc.d apache2 defaults

Set the `<start><stop>` levels of the script script:

sudo update-rc.d apache2 defaults 21

The above sets start to `2` and stop to `1`.

#init directory

`/etc/init` is Upstart specific. It contains scripts that correspond to Upstart services.
Expand Down Expand Up @@ -147,33 +177,23 @@ Examples:
sudo service apache2 restart
sudo restart apache2

##script location

Some systems such as Ubuntu use upstart, newer replacement to the `system v` init system

- `/etc/init`: upstart configuration files

Named services that can be used via:
Service only works for Upstart services, it does not see System V ones.

sudo service XXX start
##/etc/init

correspond to:
Upstart configuration files

/etc/init/XXX.conf
Named services that can be used via:

files in this directory.
sudo service XXX start

- `/etc/init.d`: classic System V rc dirs
correspond to:

Upstart is backwards compatible and can also understand:
/etc/init/XXX.conf

/etc/init.d/XXX
files in this directory.

as service:

sudo service XXX start

##start on
###start on

Determines event when the startup script will start.

Expand All @@ -191,25 +211,13 @@ To start after `/etc/fstab` mountings have been done on Ubuntu 12.04, use:

start on stopped mountall

##update-rc.d

CLI tool that manages symlinks between `/etc/init.d` and `/etc/rcX`.

Prevent a service from starting at startup (remove the symlink):
##Disable upstart services at boot

sudo update-rc.d apache2 disable

Enable a service:

sudo update-rc.d apache2 defaults
The only way seems to be manually modifying the file to comment out the `start` line:

Set the `<start><stop>` levels of the script script:

sudo update-rc.d apache2 defaults 21

The above sets start to `2` and stop to `1`.
<http://askubuntu.com/questions/19320/how-to-enable-or-disable-services>

##sysv-rc-config
##sysv-rc-conf

ncurses manager of Upstart scripts.

Expand Down
Binary file added logo.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 19 additions & 10 deletions perl/main.pl
Expand Up @@ -321,12 +321,6 @@
my @a = ("a0b1" =~ m/(\d)/g);
#@a == ["0", "1"] or die;

# Loop multiple matches:

my $s = "a0";
$s =~ s/a(.)/b$1/ or die;
#$s == "b0" or die;

# Almost every backslash escape has a meaning in Perl.

#- `\A`: Matches only at the beginning of a string
Expand All @@ -343,7 +337,20 @@

# `e` says that the replace will be an arbitrary Perl rexpression.

#defalut variables
##s/ operator

# Substitution:

my $s = "a0";
$s =~ s/a(.)/b$1/ or die;
$s == "b0" or die;

my $s = "a c";
$s =~ s/a\b/b/ or die;
$s == "b c" or die;


#Defalut variables

##sources

Expand Down Expand Up @@ -406,13 +413,13 @@

print $0;

##command line arguments
##Command line arguments

# TODO

#say $ARGV[0];

##regex
##Regex related special variables

#- $1..$9 #nth capturing group of last regex match

Expand All @@ -424,7 +431,7 @@

#- $+

##environment
##Environment

say "ENV";
foreach my $key (keys %ENV) {
Expand Down Expand Up @@ -582,3 +589,5 @@

`true`;
print $?, "\n";

print 'ALL ASSERTS PASSED'
58 changes: 58 additions & 0 deletions ubuntu/apt-file.md
@@ -0,0 +1,58 @@
#apt-file

Search for and list package files. **very** useful to know: which package provides a missing file like a `bin/name` or `include/name.h`?

sudo aptitude install apt-file
apt-file update
f=

##search

Search for file `"$F"` in packages.

apt-file search "$f"

Literal full path substring match

Use Perl regex:

apt-file search -x "a.c"

Combo: search for an executable called `a2x`:

apt-file search bin/a2x

##Show

Shows files in package `p`:

p=
apt-file show "$p"

##Get info on packages before installing them

List package dependencies

apt-cache depends $PKG

Find who depends on `$PKG` (reverse dependencies):

sudo apt-rdepends -r $PKG

Get basic information about a package:

apt-cache show $PKG

Get detailed information about a package:

apt-cache showpkg $PKG

sudo aptitude install debtags
debtags tag ls $PKG

Package naming conventions:

-dev: headers and libs, no docs
-doc: documentation
-test: tests

0 comments on commit 5d838b9

Please sign in to comment.