What is DevOps?

What is DevOps? DevOps is a methodology that integrates development (Dev) and operations (Ops). It is a culture and a set of practices that enable development and operations teams to collaborate closely to deliver software faster and more reliably. Core Principles of DevOps 1. Culture Establish a culture of collaboration and break down silos between development and operations teams Foster transparency in communication to improve understanding across teams Share responsibility for both successes and failures 2. Automation Increase efficiency by automating repetitive tasks Reduce errors caused by manual processes Automate the entire process from development to deployment 3. Measurement Collect and analyze data from all processes Measure performance to identify areas of improvement Monitor continuously to detect problems early 4. Sharing Share knowledge and experience across teams Document and share best practices Standardize tools and processes 5. Feedback Collect user feedback quickly Continuously improve based on collected insights Detect and rectify issues rapidly Key Activities in DevOps 1. Continuous Integration and Delivery Integrate code changes frequently Perform automated testing Enable reliable and fast deployments 2. Infrastructure Management Manage infrastructure as code Utilize cloud services effectively Build scalable and resilient systems 3. Monitoring and Logging Monitor system health in real-time Respond quickly to issues Continuously manage performance and stability Roles of a DevOps Engineer Technical Roles Build and maintain automation tools Operate cloud environments Monitor systems and troubleshoot issues Manage and optimize security Non-Technical Roles Facilitate communication between teams Propose process improvements Create and share technical documentation Educate and mentor team members Considerations for Adopting DevOps 1. Organizational Readiness Assess current organizational culture Manage resistance to change Establish a gradual adoption plan 2. Tool Selection Consider team’s skill level Ensure compatibility with existing systems Evaluate scalability and maintainability 3. Education and Training Provide necessary technical training Train teams on new tool usage Foster a culture of continuous learning Conclusion DevOps is a holistic approach that requires not only technological changes but also a shift in organizational culture. Balancing both technical and cultural aspects is essential for successful DevOps implementation. It is crucial to develop a strategy that aligns with the organization’s context and goals, and to adopt a gradual approach to progress. ...

June 22, 2024 · 2 min · 361 words · In-Jun Hwang

Useful VSCode Shortcuts Collection

Visual Studio Code (VSCode) is a free, open-source code editor developed by Microsoft. VSCode provides users with an efficient coding environment through various features including multi-language support, debugging, Git control, and plugin support. Let’s explore how to increase productivity and use VSCode more efficiently through various shortcuts. General Commands and Shortcuts Ctrl+Shift+P, F1: Opens the command palette where you can execute various commands, such as searching files or changing specific settings. Ctrl+P: Quickly search and open files. You can select from the file list by typing part of the filename. Ctrl+Shift+N: Open a new VSCode window or instance. Useful when working on multiple projects simultaneously. Ctrl+W: Close the current window or instance. Useful for quickly organizing multiple tabs. Ctrl+,: Open user settings to configure various environment settings like themes, font size, and extension settings. Ctrl+K Ctrl+S: Open keyboard shortcut settings to customize shortcuts according to your preferences. Basic Editing Features and Shortcuts Ctrl+X: Cut the current line when no text is selected. Cuts only the selected text when text is selected. Ctrl+C: Copy the current line when no text is selected. Copies only the selected text when text is selected. Alt+↓ / ↑: Move the current line up or down. Useful for rearranging code blocks. Ctrl+Shift+K: Delete the current line. Deletes all selected lines if multiple lines are selected. Ctrl+Enter / Ctrl+Shift+Enter: Insert a new line below/above the current line. Useful for quickly adding new code. Ctrl+Shift+\: Jump to the matching bracket. Helps in understanding nested brackets. Ctrl+] / Ctrl+[: Indent/outdent the current line. Useful for aligning code format. Home / End: Move to the beginning/end of the current line. Ctrl+Home / End: Move to the beginning/end of the file. Ctrl+↑ / ↓: Scroll up/down one line at a time in the current window. Useful for quickly scanning code. Alt+PgUp / PgDn: Scroll up/down one page at a time. Ctrl+Shift+[ / ]: Fold/unfold code regions. Useful for organizing code by hiding specific code blocks. Ctrl+K Ctrl+[ / ]: Fold/unfold all sub-regions. Ctrl+K Ctrl+0 / Ctrl+K Ctrl+J: Fold/unfold all code regions. Ctrl+K Ctrl+C: Add line comment to selected lines. Ctrl+K Ctrl+U: Remove line comment from selected lines. Ctrl+/: Toggle line comment for current line. Ctrl+Shift+A: Toggle block comment for selected block. Alt+Z: Toggle word wrap. Shows long lines wrapped to fit the screen. Rich Language Editing Features and Shortcuts Ctrl+Space, Ctrl+I: Show code completion suggestions while writing code. Ctrl+Shift+Space: Show parameter hints when calling functions. Ctrl+Shift+I: Automatically format the current document. Ctrl+K Ctrl+F: Automatically format the selected portion. F12: Go to definition at cursor position. Ctrl+Shift+F10: Preview definition at cursor position. Ctrl+K F12: Open definition at cursor position in new window. Ctrl+.: Show quick fixes for code errors. Shift+F12: Show references at cursor position. F2: Rename variable or function. Ctrl+K Ctrl+X: Remove trailing whitespace. Ctrl+K M: Change language mode of current file. Multi-cursor and Selection Features Alt+Click: Insert cursor at multiple positions. Shift+Alt+↑ / ↓: Add cursor above/below. Ctrl+U: Undo last cursor operation. Shift+Alt+I: Insert cursor at end of each selected line. Ctrl+L: Select current line. Ctrl+Shift+L: Select all occurrences of current selection. Ctrl+F2: Select all occurrences of current word. Shift+Alt+→ / ←: Expand/shrink selection. Shift+Alt+drag: Column (box) selection. Display Management F11: Toggle full screen mode. Shift+Alt+0: Toggle editor layout between horizontal/vertical. Ctrl+= / -: Zoom in/out. Ctrl+B: Toggle sidebar visibility. Ctrl+Shift+E: Show explorer or move focus to it. Ctrl+Shift+F: Show search panel. Ctrl+Shift+G: Show source control panel. Ctrl+Shift+D: Show debug panel. Ctrl+Shift+X: Show extensions panel. Ctrl+Shift+H: Use find and replace in files. Ctrl+Shift+J: Toggle search details. Ctrl+Shift+C: Open new command prompt or terminal. Ctrl+K Ctrl+H: Show output panel. Ctrl+Shift+V: Open Markdown preview. Ctrl+K V: Open Markdown preview to the side. Ctrl+K Z: Enable Zen mode. Press Esc twice to exit. Search and Replace Features Ctrl+F: Find in current file. Ctrl+H: Replace in current file. F3 / Shift+F3: Find next/previous match. Alt+Enter: Select all occurrences of find match. Ctrl+D: Add next occurrence to selection. Ctrl+K Ctrl+D: Move last selection to next find match. Navigation and Movement Ctrl+T: Show all symbols. Ctrl+G: Go to specific line. Ctrl+P: Go to specific file. Ctrl+Shift+O: Go to symbol. Ctrl+Shift+M: Show problems panel. F8: Go to next error or warning. Shift+F8: Go to previous error or warning. Ctrl+Shift+Tab: Navigate editor group history. Ctrl+Alt+-: Go back. Ctrl+Shift+-: Go forward. Ctrl+M: Toggle tab move focus. Editor Management and Shortcuts Ctrl+W: Close current editor. Ctrl+K F: Close current folder. Ctrl+\: Split editor horizontally. Ctrl+1 / 2 / 3: Focus first, second, third editor group. Ctrl+K Ctrl+← / →: Focus previous/next editor group. Ctrl+Shift+PgUp / PgDn: Move editor left/right. Ctrl+K ← / →: Move active editor group left/up or right/down. File Management and Shortcuts Ctrl+N: Create new file. Ctrl+O: Open file. Ctrl+S: Save file. Ctrl+Shift+S: Save file as. Ctrl+W: Close file. Ctrl+K Ctrl+W: Close all files. Ctrl+Shift+T: Reopen closed editor. Ctrl+K Enter: Keep preview mode editor. Ctrl+Tab: Open next editor. Ctrl+Shift+Tab: Open previous editor. Ctrl+K P: Copy path of active file. Ctrl+K R: Reveal active file in Explorer. Ctrl+K O: Open active file in new window/instance. Debug and Shortcuts F9: Toggle breakpoint. F5: Start/continue debugging. F11 / Shift+F11: Step into/out of code while debugging. F10: Step over code while debugging. Shift+F5: Stop debugging. Ctrl+K Ctrl+I: Show hover information. Integrated Terminal and Shortcuts Ctrl+`: Open integrated terminal. Ctrl+Shift+`: Create new terminal. Ctrl+Shift+C: Copy selected text. Ctrl+Shift+V: Paste selected text. Ctrl+Shift+↑ / ↓: Scroll up/down in terminal. Shift+PgUp / PgDn: Scroll up/down one page at a time. Shift+Home / End: Scroll to top/bottom of terminal. VSCode provides many more shortcuts beyond those introduced above. Let’s practice using VSCode shortcuts to code more efficiently. You can find the complete list of VSCode shortcuts here. ...

June 21, 2024 · 5 min · 943 words · In-Jun Hwang

Understanding the Floyd-Warshall Algorithm

Floyd-Warshall Algorithm The Floyd-Warshall algorithm is an algorithm that finds the shortest paths between all pairs of vertices in a graph. It can be used on graphs with negative weights. It can also be used on graphs with negative cycles. It is implemented using dynamic programming. Recurrence Relation D_{ij} = min(D_{ij}, D_{ik} + D_{kj}) Procedure Initialize a 2D array. Iterate through all the vertices using three nested loops. Update the shortest paths using the recurrence relation. Example Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 #include <iostream> #include <vector> using std::cin; using std::cout; using std::min; using std::vector; #define INF 1000000000 int main() { int n, m; cin >> n >> m; vector<vector<int>> graph(n + 1, vector<int>(n + 1, INF)); for (int i = 1; i <= n; i++) { graph[i][i] = 0; } for (int i = 0; i < m; i++) { int a, b, c; cin >> a >> b >> c; graph[a][b] = c; } for (int k = 1; k <= n; k++) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j]); } } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (graph[i][j] == INF) { cout << "INF "; } else { cout << graph[i][j] << ' '; } } cout << ' '; } return 0; } Advantages It can be used to find the shortest paths between all pairs of vertices. It can be used on graphs with negative weights. Disadvantages It is slower than Dijkstra’s algorithm for finding the shortest path from one vertex to another. It cannot find the shortest paths if the graph contains a negative cycle. Time Complexity The Floyd-Warshall algorithm has a time complexity of O(n^3) where n is the number of vertices.

June 17, 2024 · 2 min · 368 words · In-Jun Hwang

Exploring Bellman-Ford Algorithm

Bellman-Ford Algorithm It is one of the algorithms that find the shortest path. Bellman-Ford algorithm is an algorithm to find the shortest path from the start vertex to all other vertices. It is similar to Dijkstra’s algorithm but can be used even on graphs with negative weights. Order Initialize an array to store the distances from the start vertex to each vertex. Visit the start vertex. Update the distances from the start vertex to other vertices. ...

June 17, 2024 · 3 min · 436 words · In-Jun Hwang

Dijkstra's Algorithm Explained

Dijkstra’s Algorithm Dijkstra’s algorithm is an algorithm for finding the shortest path from a single source vertex to all other vertices in a weighted graph. It is similar to breadth-first search (BFS) in that it explores the graph by keeping track of the shortest known distance to each vertex. Steps Initialize an array to store the distance from the source vertex to each vertex. Mark the source vertex as visited. ...

June 17, 2024 · 3 min · 477 words · In-Jun Hwang