diff --git a/sheets/MegaCli b/sheets/MegaCli index 124bfc5..bfdda54 100644 --- a/sheets/MegaCli +++ b/sheets/MegaCli @@ -1,5 +1,5 @@ # MegaCli introduced by LSI as a command line administration of LSI MegaRaid controllers. -# With megacli we can create physical raids, gather info about raids and monitor raids. +# With megacli we can create physical raids, gather info about raids and monitor raids. # Install MegaCLI yum install MegaCli # CentOS diff --git a/sheets/_cpp/hello b/sheets/_cpp/hello index 0c7e255..8cabcb2 100644 --- a/sheets/_cpp/hello +++ b/sheets/_cpp/hello @@ -7,7 +7,7 @@ // To Compile w/ specific executable name: g++ my_script.cpp -o my.executable // To Execute: ./my.executable -int main() { +int main() { std::cout << "Hello" << endl; return 0; } diff --git a/sheets/_elm/hello b/sheets/_elm/hello index e7146c7..4449b86 100644 --- a/sheets/_elm/hello +++ b/sheets/_elm/hello @@ -7,7 +7,7 @@ # elm package install elm-lang/html # after that create Hello.elm in this directory # To start: -# elm reactor +# elm reactor # Read more here: # https://www.elm-tutorial.org/en/01-foundations/01-hello.html module Hello exposing (..) diff --git a/sheets/_go/Axioms b/sheets/_go/Axioms index 26e9933..455e675 100644 --- a/sheets/_go/Axioms +++ b/sheets/_go/Axioms @@ -21,6 +21,6 @@ c <- 1 c <- 2 close(c) for i := 0; i < 3; i++ { - fmt.Printf("%d ", <-c) + fmt.Printf("%d ", <-c) } // 1 2 0 diff --git a/sheets/_go/Channels b/sheets/_go/Channels index 99cebd5..95791a4 100644 --- a/sheets/_go/Channels +++ b/sheets/_go/Channels @@ -3,7 +3,7 @@ ch <- 42 // Send a value to the channel ch. v := <-ch // Receive a value from ch // Create a buffered channel. -// Writing to a buffered channels does not block +// Writing to a buffered channels does not block // if less than unread values have been written. ch := make(chan int, 100) // Non-buffered channels block. diff --git a/sheets/_go/Pointers b/sheets/_go/Pointers index e6a1396..c71ae57 100644 --- a/sheets/_go/Pointers +++ b/sheets/_go/Pointers @@ -4,4 +4,4 @@ r := &Vertex{1, 2} // r is also a pointer to a Vertex // The type of a pointer to a Vertex is *Vertex // new creates a pointer to a new struct instance -var s *Vertex = new(Vertex) +var s *Vertex = new(Vertex) diff --git a/sheets/_go/func b/sheets/_go/func index afe8e41..b002a22 100644 --- a/sheets/_go/func +++ b/sheets/_go/func @@ -68,7 +68,7 @@ func outer() (func() int, int) { func main() { fmt.Println(adder(1, 2, 3)) // 6 fmt.Println(adder(9, 9)) // 18 - + nums := []int{10, 20, 30} fmt.Println(adder(nums...)) // 60 } diff --git a/sheets/_go/go b/sheets/_go/go index f71afb7..a680137 100644 --- a/sheets/_go/go +++ b/sheets/_go/go @@ -1,4 +1,4 @@ -// Goroutines are lightweight threads (managed by Go, not OS threads). +// Goroutines are lightweight threads (managed by Go, not OS threads). // `go f(a, b)` starts a new goroutine which runs `f` (given `f` is a function). // // just a function (which can be later started as a goroutine) diff --git a/sheets/_go/switch b/sheets/_go/switch index f8ca78b..821533e 100644 --- a/sheets/_go/switch +++ b/sheets/_go/switch @@ -10,7 +10,7 @@ default: fmt.Println("Other") } -// as with for and if, you can have an assignment statement before the switch value +// as with for and if, you can have an assignment statement before the switch value switch os := runtime.GOOS; os { case "darwin": ... } diff --git a/sheets/_js/1line b/sheets/_js/1line index 81cc675..5a476af 100644 --- a/sheets/_js/1line +++ b/sheets/_js/1line @@ -8,7 +8,7 @@ var newA = myArray.slice(0); 'A'.replace(/<[^>]+>/gi, ''); // Reverse a string -var str = "abc def ghi."; +var str = "abc def ghi."; str.split('').reverse().join(''); // '.ihg fed cba' // Reverse order of words in a string diff --git a/sheets/_mathematica/levelspec b/sheets/_mathematica/levelspec index f6ddc1b..ca01f3a 100644 --- a/sheets/_mathematica/levelspec +++ b/sheets/_mathematica/levelspec @@ -14,8 +14,8 @@ Map[f,l,{2,5}] (* The default levelspec is {1} *) Map[f,l]===Map[f,l,{1}] -(* +(* A positive level n consists of all parts of expr specified by n indices. A negative level -n consists of all parts of expr with depth n. Level 0 corresponds to the whole expression. -*) \ No newline at end of file +*) diff --git a/sheets/_perl/subroutines b/sheets/_perl/subroutines index 5ab5f48..95b04a5 100644 --- a/sheets/_perl/subroutines +++ b/sheets/_perl/subroutines @@ -28,7 +28,7 @@ named_params_example({ sub named_params_with_defaults { my ( $arg ) = @_; # Use my ( $self, $arg ) = @_; if you are in object land. - # + # # Set defaults # If option given Use options Else my $one = exists $arg->{one} ? $arg->{one} : "default1"; diff --git a/sheets/_perl6/hello b/sheets/_perl6/hello index 45c12ed..669b742 100644 --- a/sheets/_perl6/hello +++ b/sheets/_perl6/hello @@ -1,4 +1,4 @@ -# to install: +# to install: # (Debian/Ubuntu) apt-get install rakudo # (Fedora/CentOS) yum install perl6 (or rakudo) # to execute: perl6 my_script.pl diff --git a/sheets/_psql/tables b/sheets/_psql/tables index 15d6225..f324eef 100644 --- a/sheets/_psql/tables +++ b/sheets/_psql/tables @@ -22,7 +22,7 @@ ALTER TABLE table_name ALTER COLUMN [SET DEFAULT value | DROP DEFAULT] ALTER TABLE table_name ADD PRIMARY KEY (column,...); -- Remove the primary key from a table -ALTER TABLE table_name +ALTER TABLE table_name DROP CONSTRAINT primary_key_constraint_name; -- Rename a table diff --git a/sheets/_python3/classes b/sheets/_python3/classes index 186eee5..42fe515 100644 --- a/sheets/_python3/classes +++ b/sheets/_python3/classes @@ -3,13 +3,13 @@ class Dog: # __init__ is the constructor, run on instantiation # The 'self' parameter refers to the calling instance of the class. - # It's automatically provided to methods called on an instance of this + # It's automatically provided to methods called on an instance of this # class. It can be named anything, but 'self' is the convention. def __init__(self, name): self.name = name # Class methods (or static methods) are created by adding the staticmethod - # decorator. The 'self' parameter is not passed to these methods. + # decorator. The 'self' parameter is not passed to these methods. @staticmethod def unrelated_class_method(): print('this is not an instance method') diff --git a/sheets/_rust/threads b/sheets/_rust/threads index caef519..9e260f8 100644 --- a/sheets/_rust/threads +++ b/sheets/_rust/threads @@ -6,7 +6,7 @@ fn main() { let t = thread::spawn(|| { println!("In a new thread!"); }); - + // Wait for execution of spawned thread to join back up with main thread let result = t.join(); diff --git a/sheets/_scala/DataStructures b/sheets/_scala/DataStructures index 2fc575b..740cc8c 100644 --- a/sheets/_scala/DataStructures +++ b/sheets/_scala/DataStructures @@ -5,7 +5,7 @@ // This example would be a Tuple3 (1,2,3) -// tuple sugar +// tuple sugar // This example would be a Tuple2 (1 -> 2) //same as (1, 2) diff --git a/sheets/_scala/ObjectOrientation b/sheets/_scala/ObjectOrientation index bd9939e..1ff93d0 100644 --- a/sheets/_scala/ObjectOrientation +++ b/sheets/_scala/ObjectOrientation @@ -23,7 +23,7 @@ class C(var x: R) { // // alternative constructor def this = this(42) -} +} // anonymous class new{ ... } diff --git a/sheets/_scala/Variables b/sheets/_scala/Variables index 5080392..bf366da 100644 --- a/sheets/_scala/Variables +++ b/sheets/_scala/Variables @@ -9,7 +9,7 @@ val x = 5 // BAD x = 5 -// lazy value +// lazy value // immutable, evaluated once but only when called lazy val x = 5 diff --git a/sheets/az b/sheets/az index 06f9abe..bce8d50 100644 --- a/sheets/az +++ b/sheets/az @@ -5,7 +5,7 @@ curl -L https://aka.ms/InstallAzureCli | bash # create a resource group named "MyResourceGroup" in the westus2 region of Azure -az group create -n MyResourceGroup -l westus2 +az group create -n MyResourceGroup -l westus2 # create a Linux VM using the UbuntuTLS image, with two attached storage disks of 10 GB and 20 GB az vm create -n MyLinuxVM -g MyResourceGroup --ssh-key-value $HOME/.ssh/id_rsa.pub --image UbuntuLTS --data-disk-sizes-gb 10 20 diff --git a/sheets/bonnie b/sheets/bonnie index ea57bc9..66f08c3 100644 --- a/sheets/bonnie +++ b/sheets/bonnie @@ -1,4 +1,4 @@ -# Bonnie++ +# Bonnie++ # disk and file system benchmarking tool for measuring I/O performance # benchmark disk mounted at /tmp/; use `user` for that diff --git a/sheets/btrfs b/sheets/btrfs index b5dfae2..5317d11 100644 --- a/sheets/btrfs +++ b/sheets/btrfs @@ -1,7 +1,7 @@ # Create a btrfs file system on /dev/sdb, /dev/sdc, and /dev/sdd mkfs.btrfs /dev/sdb /dev/sdc /dev/sdd -# btrfs with just one hard drive, metadata not redundant +# btrfs with just one hard drive, metadata not redundant # (this is danegerous: if your metadata is lost, your data is lost as well) mkfs.btrfs -m single /dev/sdb diff --git a/sheets/bzr b/sheets/bzr index a980773..fa53b7f 100644 --- a/sheets/bzr +++ b/sheets/bzr @@ -2,7 +2,7 @@ cd ~/.bazaar/plugins bzr branch lp:bzr-fastimport fastimport # you can do it manually: -# pip install +# pip install # python setup.py build_ext -i # mv ... ~/.bazaar/plugins # probably you will need this patch: diff --git a/sheets/curl b/sheets/curl index e599063..f2d6850 100644 --- a/sheets/curl +++ b/sheets/curl @@ -14,7 +14,7 @@ curl http://example.com/pic[1-24].jpg curl -L http://example.com/file # Download a file and pass HTTP Authentication -curl -u username:password URL +curl -u username:password URL # Download a file with a Proxy curl -x proxysever.server.com:PORT http://addressiwantto.access diff --git a/sheets/dcfldd b/sheets/dcfldd index 0d9daf3..c355d8f 100644 --- a/sheets/dcfldd +++ b/sheets/dcfldd @@ -1,4 +1,4 @@ -# enhanced version of GNU dd with features useful for forensics and security. +# enhanced version of GNU dd with features useful for forensics and security. # includes ability to have mulitple output targets # write file image to an SD card showing a progress bar based on filesize diff --git a/sheets/identify b/sheets/identify index a3f7d82..450a1ec 100644 --- a/sheets/identify +++ b/sheets/identify @@ -1,4 +1,4 @@ -# identify +# identify # # describes the format and characteristics of one or more image files diff --git a/sheets/ioreg b/sheets/ioreg index d4b49f2..48fca39 100644 --- a/sheets/ioreg +++ b/sheets/ioreg @@ -1,4 +1,4 @@ -# ioreg +# ioreg # show I/O Kit registry (Mac OS X) # find out the arch of the efi firmware in a Mac diff --git a/sheets/jq b/sheets/jq index 05be235..842203a 100644 --- a/sheets/jq +++ b/sheets/jq @@ -58,7 +58,7 @@ jq 'flatten(1)' # Converting to csv jq '.[] | [.foo, .bar] | @csv' -r -# +# # [{ "foo": 1, "bar": 2, "baz":3 }] # => 1,2 diff --git a/sheets/jslint b/sheets/jslint index f34ff30..3b13428 100644 --- a/sheets/jslint +++ b/sheets/jslint @@ -1,5 +1,5 @@ # jslint -# +# # The JavaScript Code Quality Tool written by Dougls Crockford # to install jslint diff --git a/sheets/julia b/sheets/julia index 9aec76d..6ec9e15 100644 --- a/sheets/julia +++ b/sheets/julia @@ -1,4 +1,4 @@ -# Julia +# Julia # high-level dynamic programming language designed to address the needs of high-performance numerical analysis # and computational science while also being effective for general-purpose programming diff --git a/sheets/launchctl b/sheets/launchctl index b2def36..1631f6d 100644 --- a/sheets/launchctl +++ b/sheets/launchctl @@ -9,11 +9,11 @@ # whenever the user logs in: launchctl load ~/Library/LaunchAgents/my_script.plist -# Activate an agent which requires root privileges to run +# Activate an agent which requires root privileges to run # and/or should be loaded whenever any user logs in (note the absence of ~ in the path): sudo launchctl load /Library/LaunchAgents/root_script.plist -# Activate a system-wide daemon to be loaded +# Activate a system-wide daemon to be loaded # whenever the system boots up (even if no user logs in): sudo launchctl load /Library/LaunchDaemons/system_daemon.plist diff --git a/sheets/libreoffice b/sheets/libreoffice index d5a0df8..1adf892 100644 --- a/sheets/libreoffice +++ b/sheets/libreoffice @@ -4,6 +4,6 @@ libreoffice --headless --convert-to pdf *.pptx # Save them to a different directory? libreoffice --headless --convert-to pdf *.docx --outdir ~/docs/ -# Convert files nested inside folders? +# Convert files nested inside folders? # This uses sharkdp/fd, you could use GNU find, xargs etc. fd -e doc -e docx -x libreoffice --headless --convert-to pdf --outdir {//} {} diff --git a/sheets/ncmpcpp b/sheets/ncmpcpp index 017fb66..7142b53 100644 --- a/sheets/ncmpcpp +++ b/sheets/ncmpcpp @@ -1,6 +1,6 @@ # ncmpcpp is an mpd client (compatible with mopidy) with a UI very similar to ncmpc, # but it provides new useful features such as support for regular expressions for library searches, -# extended song format, items filtering, the ability to sort playlists, and a local filesystem browser. +# extended song format, items filtering, the ability to sort playlists, and a local filesystem browser. # configure ncmpcpp mkdir ~/.ncmpcpp diff --git a/sheets/objdump b/sheets/objdump index 6ad979e..b1a97c0 100644 --- a/sheets/objdump +++ b/sheets/objdump @@ -1,4 +1,4 @@ -# objdump +# objdump # program for displaying various information about object files # Display the contents of the overall file header diff --git a/sheets/percol b/sheets/percol index a2fba69..999d087 100644 --- a/sheets/percol +++ b/sheets/percol @@ -1,6 +1,6 @@ # percol # -# adds flavor of interactive filtering to the traditional pipe concept of UNIX shell +# adds flavor of interactive filtering to the traditional pipe concept of UNIX shell # to install percol sudo pip install percol diff --git a/sheets/perl6 b/sheets/perl6 index 727a0a6..93eb50d 100644 --- a/sheets/perl6 +++ b/sheets/perl6 @@ -2,7 +2,7 @@ # The Perl 6 Language Implementation # to install perl6 (in Debian/Ubuntu) -apt-get install rakudo +apt-get install rakudo # To install rakudobrew and zef (perl 6 package management) git clone https://github.com/tadzik/rakudobrew ~/.rakudobrew diff --git a/sheets/php b/sheets/php index 9a815ed..3e5eaaf 100644 --- a/sheets/php +++ b/sheets/php @@ -1,4 +1,4 @@ -# PHP is a server-side scripting language designed primarily for web development +# PHP is a server-side scripting language designed primarily for web development # but also used as a general-purpose programming language # To view the php version: diff --git a/sheets/rclone b/sheets/rclone index 9f42c53..014dce6 100644 --- a/sheets/rclone +++ b/sheets/rclone @@ -11,7 +11,7 @@ rclone ls remote:path rclone copy /local/path remote:path # Sync /local/path to the remote -rclone sync /local/path remote:path +rclone sync /local/path remote:path # Server side Copy rclone copy s3:oldbucket s3:newbucket diff --git a/sheets/rustup b/sheets/rustup index 42df10f..a2f9198 100644 --- a/sheets/rustup +++ b/sheets/rustup @@ -1,5 +1,5 @@ # rustup -# The Rust toolchain installer +# The Rust toolchain installer # update rustup toolchain rustup update diff --git a/sheets/sox b/sheets/sox index d1e4079..4a5bb02 100644 --- a/sheets/sox +++ b/sheets/sox @@ -30,7 +30,7 @@ sox ${mono_wav} -c 2 ${stereo_wav} # Generate Different Types of Sounds # ${len} - length of audio to synthesize, hh:mm:ss.frac # ${freq} - frequencies at the beginning/end of synthesis in Hz -# ${type} is one of sine, square, triangle, sawtooth, trapezium, exp, +# ${type} is one of sine, square, triangle, sawtooth, trapezium, exp, # [white]noise, pinknoise, brown-noise # sox -n synth ${len} ${type} ${freq} sox -r 8000 -n output.wav synth 3 sine 300-3300 diff --git a/sheets/systemd-sysvinit b/sheets/systemd-sysvinit index a135cb9..fd90d94 100644 --- a/sheets/systemd-sysvinit +++ b/sheets/systemd-sysvinit @@ -1,7 +1,7 @@ # SysVinit to Systemd Cheatsheet # Services #------------------------------------------------------------------------------------------------------------------------------------------------- -# Sysvinit Command Systemd Command Notes +# Sysvinit Command Systemd Command Notes #------------------------------------------------------------------------------------------------------------------------------------------------- # service frobozz start systemctl start frobozz Used to start a service (not reboot persistent) # service frobozz stop systemctl stop frobozz Used to stop a service (not reboot persistent) @@ -10,19 +10,19 @@ # service frobozz condrestart systemctl condrestart frobozz Restarts if the service is already running. # service frobozz status systemctl status frobozz Tells whether a service is currently running. # ls /etc/rc.d/init.d/ systemctl Used to list the services that can be started or stopped -# (or) systemctl list-unit-files --type=service +# (or) systemctl list-unit-files --type=service # (or) ls /lib/systemd/system/*.service /etc/systemd/system/*.service # chkconfig frobozz on systemctl enable frobozz Turn the service on, for start at next boot, or other trigger. # chkconfig frobozz off systemctl disable frobozz Turn the service off for the next reboot, or any other trigger. # chkconfig frobozz systemctl is-enabled frobozz Used to check whether a service is configured to start or not in the current environment. -# chkconfig --list systemctl list-unit-files --type=service -# (or) ls /etc/systemd/system/*.wants/ +# chkconfig --list systemctl list-unit-files --type=service +# (or) ls /etc/systemd/system/*.wants/ # Print a table of services that lists which runlevels each is configured on or off -# chkconfig --list | grep 5:on systemctl list-dependencies graphical.target +# chkconfig --list | grep 5:on systemctl list-dependencies graphical.target # Print a table of services that will be started when booting into graphical mode -# chkconfig frobozz --list ls /etc/systemd/system/*.wants/frobozz.service +# chkconfig frobozz --list ls /etc/systemd/system/*.wants/frobozz.service # Used to list what levels this service is configured on or off -# chkconfig frobozz --add systemctl daemon-reload Used when you create a new service file or modify any configuration +# chkconfig frobozz --add systemctl daemon-reload Used when you create a new service file or modify any configuration # SysVinit to Systemd Cheatsheet # Runlevels/targets @@ -37,9 +37,9 @@ # runlevel4.target # multi-user.target # 3 runlevel3.target Multi-user, non-graphical. Users can usually login via multiple consoles or via the network. -# multi-user.target +# multi-user.target # 5 runlevel5.target Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login. # graphical.target # 6 runlevel6.target Reboot # reboot.target -# emergency emergency.target Emergency shell +# emergency emergency.target Emergency shell diff --git a/sheets/xfs_repair b/sheets/xfs_repair index 25f74b0..65fb08a 100644 --- a/sheets/xfs_repair +++ b/sheets/xfs_repair @@ -1,5 +1,5 @@ # xfs_repair -# repair an XFS filesystem +# repair an XFS filesystem # rapair a XFS filesystem xfs_repair /dev/dm-0 diff --git a/sheets/xkb b/sheets/xkb index f604501..7f3456d 100644 --- a/sheets/xkb +++ b/sheets/xkb @@ -1,4 +1,4 @@ -# Set the keyboard layout for the current X session +# Set the keyboard layout for the current X session setxkbmap -layout "us,ru" setxkbmap -option "grp:caps_toggle,grp_led:scroll,compose:ralt" diff --git a/sheets/xset b/sheets/xset index 9b733ee..28b5840 100644 --- a/sheets/xset +++ b/sheets/xset @@ -1,5 +1,5 @@ # xset -# user preference utility for X +# user preference utility for X # Disable screen saver blanking xset s off @@ -19,5 +19,5 @@ xset dpms force off # Standby screen xset dpms force standby -# Suspend screen +# Suspend screen xset dpms force suspend