S No | Parts | Size ( Bytes ) |
Description |
1 | Boot Loader | 446 | Boot loader to load the kernel into the memory to the start the operating system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SQL : PostgreSQL | |
-- tablename - Name of the table which we want to alter the column | |
-- columnname - Name of the columnn which we want to change to varchar from other datatype. | |
ALTER TABLE | |
tablename | |
ALTER COLUMN | |
columnname type varchar using columnname::varchar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SQL : Postgresql | |
-- Query : Kill all the active connection of particular database. | |
SELECT | |
pg_terminate_backend(pid) | |
FROM | |
pg_stat_activity | |
WHERE | |
pid <> pg_backend_pid() | |
AND datname = 'dev'; -- dev- Database Name which connection needs to be terminate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# store start date to a variable | |
imeron=`date` | |
echo "Import started: OK" | |
dumpfile="/home/bob/bobiras.sql" | |
ddl="set names utf8; " | |
ddl="$ddl set global net_buffer_length=1000000;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from airflow.hooks.postgres_hook import PostgresHook | |
from airflow.models import BaseOperator | |
from airflow.utils.decorators import apply_defaults | |
class PostgresOperator(BaseOperator): | |
""" | |
Executes sql code in a specific Postgres database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from airflow.hooks.postgres_hook import PostgresHook | |
from airflow.models import BaseOperator | |
from airflow.utils.decorators import apply_defaults | |
from datetime import datetime, timedelta | |
from os import environ | |
import csv | |
class DataSourceToCsvOperator(BaseOperator): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cat <<EOT > /etc/issue | |
*********************************************************************** | |
* Access to this computer system is limited to authorised users only. * | |
* Unauthorised users may be subject to prosecution under the Crimes * | |
* Act or State legislation * | |
* * | |
* Please note, ALL CUSTOMER DETAILS are confidential and must * | |
* not be disclosed. * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Set up the serial console | |
# | |
%post | |
echo ":: Setting up Serial Console ::" >> /root/post.log | |
perl -p -i -e 's/^(default.*)$/$1\nserial --unit=0 --speed=9600 --data=8 --parity=no --stop=1\nterminal --timeout=5 serial console/' /boot/grub/grub.conf >> /root/post.log 2>&1 | |
perl -p -i -e 's/^(\s+kernel.*)$/$1 console=tty0 console=ttyS0,9600/' /boot/grub/grub.conf >> /root/post.log 2>&1 | |
echo "" >> /etc/inittab | |
echo "# Run serial console on ttyS0" >> /etc/inittab | |
echo "S1:2345:respawn:/sbin/agetty ttyS0 9600 vt100" >> /etc/inittab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | |
# START pre-kvmhost-partitions | |
# | |
set \$(list-harddrives) | |
echo "\$@" | |
disk=( \$1 \$3 ) | |
size=( \$2 \$4 ) |
OlderNewer