Latest DevOps and SysAdmin Feed

Djamgatech: AI Driven Certification Preparation App for iOS, Android, Windows
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.

DevOps Latest Feeds


DevOps Resources

  1. What is DevOps? Tackling some frequently asked questions
  2. Find Remote DevOps Jobs here.

Budget to start a web app built on the MEAN stack

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.

Web Apps Feed

  1. 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.
  2. 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.
  3. 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.
  4. AWS also offers Bitmani’s MEAN stack on EC2 instances similar to Azure DS1V2 described above and it is around $55 per month.
  5. Other suggestions

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.

Script with hash tables on windows and Linux

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.

    • Hash tables with powershell on windows

      Declaration:
      $states=@{“Alberta” = “Calgary”; “British Columbia” = “Vancouver”; “Ontario” = “Toronto” ; “Quebec” = “Montreal”}

      Name
      _____
      Value
      _______
      AlbertaCalgary
      British ColumbiaVancouver
      OntarioToronto
      QuebecMontreal

      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};

Hash tables with python on linux or windows

Hash tables are called dictionary in python.
Declaration:
dict = {‘Name’: ‘Zara’, ‘Age’: 7, ‘Class’: ‘First’}
Accessing Values
print “dict[‘Name’]: “, dict[‘Name’]
print “dict[‘Age’]: “, dict[‘Age’]
Output:
dict[‘Name’]: Zara
dict[‘Age’]: 7
Updating Dictionary
dict = {‘Name’: ‘Zara’, ‘Age’: 7, ‘Class’: ‘First’}

dict[‘Age’] = 8; # update existing entry
dict[‘School’] = “DPS School”; # Add new entry
Delete Dictionary Elements
#!/usr/bin/python

dict = {‘Name’: ‘Zara’, ‘Age’: 7, ‘Class’: ‘First’}

del dict[‘Name’]; # remove entry with key ‘Name’
dict.clear(); # remove all entries in dict
del dict ; # delete entire dictionary

Source:

  1. https://technet.microsoft.com/en-us/library/ee692803.aspx
  2. http://www.cs.mcgill.ca/~abatko/computers/programming/perl/howto/hash/
  3. http://www.tutorialspoint.com/python/python_dictionary.htm

How to pipe grep on command line on windows and Linux

How to pipe grep on command line on Windows and Linux?

Let’s find how to pipe grep or find a specific string after running a command using shell, batch and powershell (windows and Linux)

  • On Linux via shell

    ls -al | grep filename

  • On Windows via powershell

    GetChildItem | Select-Object “filename”
    or
    GetChildItem | where-Object {$_ -match “filename”}

  • On Windows via batch

    Dir | findstr “filename”

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.

# Show all the processes that contain the string "python" in their command line arguments
ps -aux | grep python

I hope this helps! Let me know if you have any questions.

JSON : JavaScript Object Notation

What is JSON : JavaScript Object Notation?

Source: https://www.json.com/

What is JSON?

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.

JSON cheat sheet

Example1: Mixed Data Types

var myObject = {
“myNumber”: 123.456,
“myString”: “abcdef”,
“myBool”: true,
“myArray”: [ “a”, “b”, “c”, “d” ],
“myObject”: { “id”: 7 },
“myNull”: null
};

Example2: Send HTTP POST request with JSON to a http://url with the following string fields: ‘first_name’, ‘last_name’, ’email’, ‘phone’,’urls’

curl -X POST -d ‘{“first_name”: “John”, “last_name”: “Doe”, “email”: “johndoe@email.com”, “phone”: “000-000-0000″,”urls”: [“https://djamga.com”,”https://enoumen.com”,”http://twitter.com/enoumen”]}’ http:/url -H ‘Content-Type: application/json’

Remove all empty lines in a file

How to Remove all empty lines in a file on Linux and Windows?

Remove empty lines from file.txt via Linux command line

  • Option 1: sed -i ‘/^$/d’ file.txt
  • Option 2: awk ‘NF > 0’ file.txt > output.txt
  • Option 3: perl -i.backup -n -e “print if /\S/” file.txt
  • Option 4: grep . file.txt > output.txt

Remove empty lines from file.txt using Powershell script on Windows
  • (gc file.txt) | ? {$_.trim() -ne “” } | set-content file.txt
  • Linux Boot process

    Let’s describe Linux Boot Process:

    The Linux boot process involves several stages, in which the operating system performs various tasks to prepare the system for use.

    1. 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.
    2. The bootloader, such as GRUB (GRand Unified Bootloader), is responsible for loading the operating system kernel and transferring control to it.
    3. The operating system kernel, which is the core of the operating system, initializes the system and starts the system services.
    4. The system services, such as the device drivers, are loaded and initialized.
    5. The operating system loads the user profile and starts the user interface, such as the desktop or the login screen.
    6. 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.

    BIOSBasic 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
    • rc.local
    • login prompt

    Source:

      1. http://unix.stackexchange.com/questions/27034/discribe-in-details-tha-boot-process-of-any-linux-system
      1. http://www.thegeekstuff.com/2011/02/linux-boot-process/
    1. Watch video here
    2. http://www.slideshare.net/dominiquec/understanding-the-boot-process

    Monitor Macbook

    How to Monitor Macbook with one single command?

    $sudo sysdiagnose -f ~/Desktop/




    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:

    top -o cpu -s 2 -u username

    List only regular file names in a directory

    How to List only regular file names in a directory on Linux and Windows

    Listing regular files in a directory without including . and .. files.


    • On Linux

      Solution 1:$ ls -p | grep -v /
      Solution 2: $ ls -F | grep -v ‘[/@=|]’
      Solution 3: $for list in `ls` ; do ls -ld $list | grep -v ^d > /dev/null && echo $list ; done ;
      Solution4:$ for list in `ls` ; do ls -ld $list | grep ^d > /dev/null || echo $list ; done ;
      Solution5 (exclude sym links):$ for list in `ls` ; do ls -ld $list | grep -v ^l > /dev/null && echo $list ; done ;


    • On Windows

      Solution 1: dir /a-d /b >..\File_List.txt

    Set Date and time via command line

    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: _

    Ace the 2023 AWS Solutions Architect Associate SAA-C03 Exam with Confidence Pass the 2023 AWS Certified Machine Learning Specialty MLS-C01 Exam with Flying Colors

    List of Freely available programming books - What is the single most influential book every Programmers should read



    #BlackOwned #BlackEntrepreneurs #BlackBuniness #AWSCertified #AWSCloudPractitioner #AWSCertification #AWSCLFC02 #CloudComputing #AWSStudyGuide #AWSTraining #AWSCareer #AWSExamPrep #AWSCommunity #AWSEducation #AWSBasics #AWSCertified #AWSMachineLearning #AWSCertification #AWSSpecialty #MachineLearning #AWSStudyGuide #CloudComputing #DataScience #AWSCertified #AWSSolutionsArchitect #AWSArchitectAssociate #AWSCertification #AWSStudyGuide #CloudComputing #AWSArchitecture #AWSTraining #AWSCareer #AWSExamPrep #AWSCommunity #AWSEducation #AzureFundamentals #AZ900 #MicrosoftAzure #ITCertification #CertificationPrep #StudyMaterials #TechLearning #MicrosoftCertified #AzureCertification #TechBooks

    Top 1000 Canada Quiz and trivia: CANADA CITIZENSHIP TEST- HISTORY - GEOGRAPHY - GOVERNMENT- CULTURE - PEOPLE - LANGUAGES - TRAVEL - WILDLIFE - HOCKEY - TOURISM - SCENERIES - ARTS - DATA VISUALIZATION
    zCanadian Quiz and Trivia, Canadian History, Citizenship Test, Geography, Wildlife, Secenries, Banff, Tourism

    Top 1000 Africa Quiz and trivia: HISTORY - GEOGRAPHY - WILDLIFE - CULTURE - PEOPLE - LANGUAGES - TRAVEL - TOURISM - SCENERIES - ARTS - DATA VISUALIZATION
    Africa Quiz, Africa Trivia, Quiz, African History, Geography, Wildlife, Culture

    Exploring the Pros and Cons of Visiting All Provinces and Territories in Canada.
    Exploring the Pros and Cons of Visiting All Provinces and Territories in Canada

    Exploring the Advantages and Disadvantages of Visiting All 50 States in the USA
    Exploring the Advantages and Disadvantages of Visiting All 50 States in the USA


    Health Health, a science-based community to discuss health news and the coronavirus (COVID-19) pandemic

    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.

    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.

    Reddit Sports Sports News and Highlights from the NFL, NBA, NHL, MLB, MLS, and leagues around the world.

    Turn your dream into reality with Google Workspace: It’s free for the first 14 days.
    Get 20% off Google Google Workspace (Google Meet) Standard Plan with  the following codes:
    Get 20% off Google Google Workspace (Google Meet) Standard Plan with  the following codes: 96DRHDRA9J7GTN6 96DRHDRA9J7GTN6
    63F733CLLY7R7MM
    63F7D7CPD9XXUVT
    63FLKQHWV3AEEE6
    63JGLWWK36CP7WM
    63KKR9EULQRR7VE
    63KNY4N7VHCUA9R
    63LDXXFYU6VXDG9
    63MGNRCKXURAYWC
    63NGNDVVXJP4N99
    63P4G3ELRPADKQU
    With Google Workspace, Get custom email @yourcompany, Work from anywhere; Easily scale up or down
    Google gives you the tools you need to run your business like a pro. Set up custom email, share files securely online, video chat from any device, and more.
    Google Workspace provides a platform, a common ground, for all our internal teams and operations to collaboratively support our primary business goal, which is to deliver quality information to our readers quickly.
    Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE
    C37HCAQRVR7JTFK
    C3AE76E7WATCTL9
    C3C3RGUF9VW6LXE
    C3D9LD4L736CALC
    C3EQXV674DQ6PXP
    C3G9M3JEHXM3XC7
    C3GGR3H4TRHUD7L
    C3LVUVC3LHKUEQK
    C3PVGM4CHHPMWLE
    C3QHQ763LWGTW4C
    Even if you’re small, you want people to see you as a professional business. If you’re still growing, you need the building blocks to get you where you want to be. I’ve learned so much about business through Google Workspace—I can’t imagine working without it.
    (Email us for more codes)