Download the AI & Machine Learning For Dummies App: iOS - Android
Latest DevOps and SysAdmin Feed
DevOps is a set of practices and tools that organizations use to accelerate software development and improve the quality of their software products. It aims to bring development and operations teams together, so they can work more collaboratively and efficiently to deliver software faster and with fewer errors.
The goal of DevOps is to automate as much of the software delivery process as possible, using tools such as continuous integration, continuous delivery, and infrastructure as code. This allows teams to move faster and release new features and bug fixes more frequently, while also reducing the risk of errors and downtime.
DevOps also emphasizes the importance of monitoring, logging, and testing to ensure that software is performing well in production. By continuously monitoring and analyzing performance data, teams can quickly identify and resolve any issues that arise.
In summary, DevOps is a combination of people, processes, and technology that organizations use to improve their software delivery capabilities, increase efficiency, and reduce risk.
What is DevOps in Simple English?
What is a System Administrator?
DevOps: In IT world, DevOps means Development Operations. The DevOps is the bridge between the developers, the servers and the infrastructure and his main role is to automate the process of delivering code to operations. DevOps on wikipedia: is a software development process that emphasizes communication and collaboration between product management, software development, and operations professionals. DevOps also automates the process of software integration, testing, deployment and infrastructure changes.[1][2] It aims to establish a culture and environment where building, testing, and releasing software can happen rapidly, frequently, and more reliably.
Download the AI & Machine Learning For Dummies App: iOS - Android
I want to start a web app built on the MEAN stack (mongoDB, express.js, angular, and node.js). How much would it cost me to host this site? What resources are there for hosting websites built on the MEAN stack?
I went through the same questions and concerns and I actually tried a couple of different cloud providers for similar environments and machines.
At Digital Ocean, you can get a fully loaded machine to develop and host at $5 per month (512 MB RAM, 20 GB disk ). You can even get a $10 credit by using this link of mine.[1] It is very easy to sign up and start. Just don’t use their web console to connect to your host. It is slow. I recommend using ssh client to connect and it is very fast.
GoDaddy will charge you around 8$ per month for a similar MEAN stack host (512 MB RAM, 1 core processor, 20 Gb disk ) for your MEAN Stack development.
Azure use bitmani’s mean stack on minimum DS1_V2 machine (1core, 3.5 gB RAM) and your average cost will be $52 per month if you never shut down the machine. The set up is a little bit more complicated that Digital Ocean, but very doable. I also recommend ssh to connect to the server and develop.
AWS also offers Bitmani’s MEAN stack on EC2 instances similar to Azure DS1V2 described above and it is around $55 per month.
All those solutions will work fine and it all depends on your budget. If you are cheap like me and don’t have a big budget, go with Digital Ocean and start with $10 off with this code.
Download the AI & Machine Learning For Dummies App: iOS - Android
How to declare and write a script with hash tables on windows and linux
A hash table, also known as a hash map, is a data structure that is used to store key-value pairs. It is an efficient way to store data that can be quickly retrieved using a unique key.
Here is an example of how to declare and write a script with a hash table in Python:
# Declare an empty hash table hash_table = {}
# Add some key-value pairs to the hash table hash_table[‘key1’] = ‘value1’ hash_table[‘key2’] = ‘value2’ hash_table[‘key3’] = ‘value3’
# Access a value using its key print(hash_table[‘key2’]) # Output: “value2”
# Modify a value using its key hash_table[‘key2’] = ‘new value’ print(hash_table[‘key2’]) # Output: “new value”
# Delete a key-value pair using the `del` statement del hash_table[‘key1’]
# Check if a key is in the hash table using the `in` operator print(‘key1’ in hash_table) # Output: False
# Output: False
In this example, we declare an empty hash table using the {} syntax. We then add some key-value pairs to the hash table using the [] syntax. We access a value using its key, modify a value using its key, delete a key-value pair using the del statement, and check if a key is in the hash table using the in operator.
I hope this helps! Let me know if you have any questions.
Add new key-value in hashtable: $states.Add(“Manitoba”,”Winnipeg”)
Remove key-value in hashtable: $states.Remove(“Manitoba”,”Winnipeg”) Change value in hashtable: $states.Set_Item(“Ontario”,”Ottawa”) Retrieve value in hashtable: $states.Get_Item(“Alberta”) Find key in hashtable: $states.ContainsKey(“Alberta”) Find Value in hashtable: $states.ContainsValue(“Calgary”) Count items in hashtable: $states.Count Sort items by Name in hashtable: $states.GetEnumerator() | Sort-Object Name -descending Sort items by Value in hashtable: $states.GetEnumerator() | Sort-Object Value -descending
Hash tables with perl on linux or windows
Declaration: my %hash = (); #Initialize a hash my $hash_ref = {}; # Initialize a hash reference. ref will return HASH Clear (or empty) a hash for (keys %hash) { delete $hash{$_}; } Clear (or empty) a hash reference for (keys %$href) { delete $href->{$_}; } Add a key/value pair to a hash $hash{ ‘key’ } = ‘value’; # hash $hash{ $key } = $value; # hash, using variables Using Hash Reference $href->{ ‘key’ } = ‘value’; # hash ref $href->{ $key } = $value; # hash ref, using variables Add several key/value pairs to a hash %hash = ( ‘key1’, ‘value1’, ‘key2’, ‘value2’, ‘key3’, ‘value3’ ); %hash = ( key1 => ‘value1’, key2 => ‘value2’, key3 => ‘value3’, );
Copy a hash my %hash_copy = %hash; # copy a hash my $href_copy = $href; # copy a hash ref Delete a single key/value pair delete $hash{$key}; delete $hash_ref->{$key};
On both Windows and Linux, you can use the grep command in combination with the | (pipe) operator to filter the output of another command. The | operator takes the output of the command on the left and passes it as input to the command on the right.
Here is an example of how to use the grep command with the | operator on both Windows and Linux:
On Linux:
# List all the files in the current directory and filter the output to show only the files that contain the word "example" ls | grep example
On Windows:
# List all the files in the current directory and filter the output to show only the files that contain the word "example" dir | findstr example
In this example, the ls (Linux) or dir (Windows) command lists all the files in the current directory, and the grep (Linux) or findstr (Windows) command filters the output to show only the lines that contain the word “example”.
You can use the grep command with the | operator in combination with other command-line utilities to perform various tasks. For example, you can use the grep command to filter the output of the ps command to show only the processes that contain a particular string in their command line arguments.
JSON is a lightweight text-based open standard designed for human-readable data. It is the most widely used format for exchanging data on the web. It originates from the JavaScript language and is represented with two primary data structures: ordered lists (recognized as ‘arrays’) and name/value pairs (recognized as ‘objects’).
Why JSON?
The JSON standard is language-independent and its data structures, arrays and objects, are universally recognized. These structures are supported in some way by nearly all modern programming languages and are familiar to nearly all programmers. These qualities make it an ideal format for data interchange on the web.
JSON vs XML
The XML specification does not match the data model for most programming languages which makes it slow and tedious for programmers to parse. Compared to JSON, XML has a low data-to-markup ratio which results in it being more difficult for humans to read and write.
JSON Data Types
Number{ “myNum”: 123.456 } A series of numbers; decimals ok; double-precision floating-point format.
String{ “myString”: “abcdef” } A series of characters (letters, numbers, or symbols); double-quoted UTF-8 with backslash escaping.
Boolean{ “myBool”: true } True or false.
Array{ “myArray”: [ “a”, “b”, “c”, “d” ] } Sequence of comma-separated values (any data type); enclosed in square brackets.
Object{ “myObject”: { “id”: 7 } }; Unordered collection of comma-separated key/value pairs; enclosed in curly braces; properties (keys) are distinct strings.
Null{ “myNull”: null } Variable with null (empty) value.
Unsupported Data Types
Undefinedvar myUndefined; Variable with no value assigned.
Datevar myDate = new Date(); Object used to work with dates and times.
Errorvar myError = new Error(); Object containing information about errors.
Regular Expressionvar myRegEx = /json/i; Variable containing a sequence of characters that form a search pattern.
Functionvar myFunction = function(){}; Variable containing a block of code designed to perform a particular task.
The Linux boot process involves several stages, in which the operating system performs various tasks to prepare the system for use.
When the system is powered on, the BIOS (Basic Input/Output System) or the UEFI (Unified Extensible Firmware Interface) performs a power-on self-test (POST) to check the hardware components and to load the bootloader.
The bootloader, such as GRUB (GRand Unified Bootloader), is responsible for loading the operating system kernel and transferring control to it.
The operating system kernel, which is the core of the operating system, initializes the system and starts the system services.
The system services, such as the device drivers, are loaded and initialized.
The operating system loads the user profile and starts the user interface, such as the desktop or the login screen.
The user can log in and start using the system.
This is a general overview of the Linux boot process. The exact sequence of events may vary depending on the specific distribution of Linux and the hardware configuration of the system.
BIOS
Basic INPUT/OUTPUT System. Executes MBR
MBR
Master Boot Record Executes GRUB
GRUB
Grand Unified Bootloader Executes kernel
KERNEL
Kernel Executes /sbin/init
INIT
Init Executes Run level programs
Run Level
Run Level Programs are executed from /etc/rc.d/rc*.d/
As power comes up the BIOS is given control
BIOS runs self tests, usually including cursory memory tests.
The BIOS then loads the first sector of the disk to be used for booting and transfers control to it.
The MBR code varies. One version will chain to the code in the first sector of the boot partition (Windows), another will load a bootloader. Windows boot proceeds from code and information in the boot partition.
The bootloader chooses kernel location and version
The bootloader prepares kernel and initrd image in memory, transfers control to kernel
Loading kernel modules
Discovering hardware and load additional kernel modules to support it
Looking for disks
R/O mount of / partition so that it can potentially be checked and repaired
init process spawn
/etc/inittab read and executing
Mounting all FSes from /etc/fstab
runlevels running (based on default runlevel in /etc/inittab) or another init method such as systemd or upstart
The result is a compressed file named sysdiagnose_YYYY.MM.DD_HH-MM-SS-TTTT.tar.gz and it contains the following: Accessibility BluetoothTraceFile.pklg DiagnosticMessages Etienne’s SystemConfiguration airport_info.txt apsd-status.txt bc_stats.txt bootstamps.txt brctl.tar.gz breadcrumbs.txt crashes_and_spins darwinup.txt dig-results.txt disks.txt diskutil.txt error_log.txt filecoordination_dump.txt footprint-all.txt fs_usage.txt fsck_hfs_user.log fsck_hfs_var.log gpt.txt ifconfig.txt ioreg ipconfig.txt kextstat.txt launchctl-list.txt locale.txt logs lsappinfo.txt lsmp.txt lsof.txt lsregister.txt microstackshots microstackshots_lastday.txt microstackshots_lasthour.txt microstackshots_lastminute.txt mount.txt netstat nfsstat.txt odutil.txt pluginkit.txt pmset_everything.txt powermetrics.txt ps.txt ps_thread.txt reachability-info.txt resolv.conf scutil.txt smcDiagnose.txt spindump.txt stackshot-last-sym.log sysctl.txt sysdiagnose.log system_profiler.spx talagent.txt taskinfo.txt thermal.txt top.txt var_run_resolv.conf vm_stat.txt zprint.txt
You can use the top command to monitor the resources of your Macbook in real-time. The top command is a built-in utility that shows the processes that are currently running on the system, along with information about their CPU and memory usage.
To use the top command, open a terminal window and type top. The output will show the list of processes, sorted by their CPU usage, with the most CPU-intensive processes at the top. You can use the q key to exit the top command.
Here are some of the key options you can use with the top command:
-o: sort the processes by a particular resource, such as CPU usage or memory usage. For example, top -o cpu will sort the processes by CPU usage.
-s: specify the delay between updates. For example, top -s 2 will update the display every 2 seconds.
-u: show the process for a particular user. For example, top -u username will show the processes for the user with the specified username.
You can use these options in combination to customize the output of the top command. For example, to monitor the CPU usage of the processes owned by a particular user, you can use the following command:
Let’s find out how to set Date and time via command line on linux and windows:
On Linux via terminal
System time (Must have sudo privilege) date -s ‘2015-07-28 15:27:30’ Hardware time Let’s set the hardware clock to the current system time: hwclock –systohc
On Windows via command prompt terminal
System time (Must have Administrator privilege) date The current date is: 07/28/2015 Enter the new date: (mm-dd-yy)_ time The current time is: 15:34:03.44 Enter the new time: _
Today I Learned (TIL) You learn something new every day; what did you learn today? Submit interesting and specific facts about something that you just found out here.
submitted by /u/jenesuispashariselon [link] [comments]
Reddit Science This community is a place to share and discuss new scientific research. Read about the latest advances in astronomy, biology, medicine, physics, social science, and more. Find and submit new publications and popular science coverage of current research.