#!/usr/bin/env bash set -eu p_host=$1 p_db=$2 . ./pg-lib.sh eval set -- "$( getopt -o h --long no-backup,help \ -n "$(basename -- "$0")" -- "$@" )" p_no_backup= while true; do case "$1" in --no-backup) p_no_backup=1 shift ;; -h|--help) cat <<USAGE $0 OPTIONS... HOST DB --no-backup USAGE exit ;; --) shift break ;; esac done hr 'copy scripts' scp pg*.sh "$p_host": hr status time ssh "$p_host" -t " ./pg-status.sh $(qs "$p_db"); apt list --installed postgresql*; " if ! [ "$p_no_backup" ]; then hr pg_dump time ssh "$p_host" " su - postgres -c $(qs 'pg_dump '"$(qs "$p_db")") " > "$p_host-$(date +%Y%m%d-%H%M%S).sql" hr 'stop pg' time ssh "$p_host" " systemctl stop postgresql; while pgrep -x postgres > /dev/null; do printf .; sleep 1; done; printf $(qs '\n'); " hr tar time ssh "$p_host" " su - postgres -c $(qs 'tar czf '"$(qs "$p_db")"'-datadir-$(date +%Y%m%d-%H%M%S).tar.gz 9.3'); " hr fname fname=$(ssh "$p_host" " su - postgres -c $(qs 'ls *.tar.gz') " | tail -n 1) hr copy time scp "$p_host:/var/lib/postgresql/$fname" . hr rm ssh "$p_host" " su - postgres -c $(qs 'rm *.tar.gz') " hr 'apt update' time ssh "$p_host" " apt update " fi main_pid=$(ssh root@"$p_host" ps --ppid 1 -o pid= -o comm= | awk '$2 == "postgres" || $2 == "postmaster" {print $1}') from=$(ssh root@"$p_host" /proc/$(printf "%q" "$main_pid")/exe --version | awk '{print $NF}') if (( "${from%%.*}" < 10 )); then from=$(echo "$from" | sed -E 's/([0-9]+\.[0-9]+).*/\1/') else from=$(echo "$from" | sed -E 's/([0-9]+).*/\1/') fi from=9.3 versions=(9.2 9.3 9.4 9.5 9.6 10) while [ "$from" != "${versions[0]}" ]; do versions=("${versions[@]:1}") done from=${versions[0]} tos=("${versions[@]:1}") for to in ${tos[@]+"${tos[@]}"}; do hr "$(printf '%s -> %s' "$from" "$to")" time ssh "$p_host" " ./pg-upgrade-1.sh --from $(qs "$from") --to $(qs "$to") " hr status time ssh "$p_host" -t " ./pg-status.sh $(qs "$p_db"); apt list --installed postgresql*; " from=$to done
pg-upgrade-1.sh:
#!/usr/bin/env bash set -eu . ./pg-lib.sh eval set -- "$( getopt -o f:,t:,d:,h --long first,last,from:,to:,database:,help \ -n "$(basename -- "$0")" -- "$@" )" p_first= p_last= p_from= p_to= p_database= while true; do case "$1" in --first) p_first=1 shift ;; --last) p_last=1 shift ;; -f|--from) p_from=$2 shift 2 ;; -t|--to) p_to=$2 shift 2 ;; -d|--database) p_database=$2 shift 2 ;; -h|--help) cat <<USAGE $0 OPTIONS... --first --last -f, --from VERSION -t, --to VERSION -d, --database NAME USAGE exit ;; --) shift break ;; esac done pg_home=/var/lib/postgresql pg_lib=/usr/lib/postgresql pg_upgrade=$pg_lib/$p_to/bin/pg_upgrade pg_bin_from=$pg_lib/$p_from/bin pg_bin_to=$pg_lib/$p_to/bin pg_data_from=$pg_home/$p_from/main pg_data_to=$pg_home/$p_to/main pg_config_from=/etc/postgresql/$p_from/main/postgresql.conf pg_config_to=/etc/postgresql/$p_to/main/postgresql.conf pg_stop() { local n=$1 printf '%s %s' -- "$n" systemctl stop postgresql while pgrep -x postgres > /dev/null; do printf .; sleep 1; done printf '\n' } if [ "$p_first" ]; then printf '%s back up database\n' -- as postgres pg_dump "$p_database" > ~/"$p_database-$(date +%Y%m%d-%H%M%S)".sql pg_stop 'stop old postgresql' printf '%s back up old datadir\n' -- as postgres cp -r "$pg_home/$p_from" "$pg_home/$p_from-$(date +%Y%m%d-%H%M%S)" printf '%s apt update\n' -- apt update fi printf '%s install new postgresql\n' -- apt -y install "postgresql-$p_to" pg_stop 'stop postgresql' printf '%s back up new datadir\n' -- as postgres cp -r "$pg_home/$p_to" "$pg_home/$p_to-$(date +%Y%m%d-%H%M%S)" printf '%s migrate data\n' -- as postgres "$pg_upgrade" -b "$pg_bin_from" -B "$pg_bin_to" \ -d "$pg_data_from" -D "$pg_data_to" \ -o " -c config_file=${pg_config_from@Q}" -O " -c config_file=${pg_config_to@Q}" printf '%s back up new postgresql config\n' -- cp "$pg_config_to" "$pg_config_to-$(date +%Y%m%d-%H%M%S)" printf '%s fix port in new postgresql config\n' -- sed -Ei 's/^(\s*port\s*=\s*)[0-9]+(.*)/\15432\2/' "$pg_config_to" printf '%s remove old postgresql\n' -- # apt -y remove "postgresql.*$p_from" apt -y purge "postgresql.*$p_from" printf '%s start postgresql\n' -- systemctl start postgresql printf '%s analyze\n' -- as postgres vacuumdb --all --analyze-only
pg-status.sh:
#!/usr/bin/env bash set -eu . ./pg-lib.sh p_db=$1 for s in $(get_service_prop postgresql* Id); do active_state=$(get_service_prop "$s" ActiveState) substate=$(get_service_prop "$s" SubState) printf '%s: %s (%s)\n' "$s" "$active_state" "$substate" if [ "$substate" = running ]; then # determine list of tables q_db=$(printf "%q" "$p_db") tables_str=$(su - postgres -c "psql -AtF ' ' -c '\\dt' $q_db | awk '{print \$2}'") _IFS=$IFS IFS=$'\n' tables=($tables_str) IFS=$_IFS # compile table string tables_str= for t in ${tables[@]+"${tables[@]}"}; do q_t=$(qi "$t") count=$(su - postgres -c "psql -Atc 'select count(*) from \"$t\"' $q_db") tables_str=$tables_str${tables_str:+, }"$t: $count" done # print table string while [ "$tables_str" ]; do pre=$(printf " %.0s" {1..4}) printf "%s%.*s\n" "$pre" $(( $(tput cols) - ${#pre} )) "$tables_str" tables_str=${tables_str:$(( $(tput cols) - ${#pre} ))} done fi done
pg-lib.sh:
as() { local user=$1 shift local cmd=() for a; do cmd+=("$(printf "%q" "$a")") done cmd=${cmd[@]+"${cmd[@]}"} su - "$user" -c "$cmd" } qs() { printf '%q' "$1" } qe() { local s=$1 delimiter=${2:-} local re='\.|\*|\[|\^|\$|\\|\+|\?|\{|\||\(' # .*[^$\+?{|( if [ "$delimiter" ]; then re=$re'|\'$delimiter fi printf "%s\n" "$s" | sed -E 's/('"$re"')/\\\1/g' } qi() { local s=$1 printf '%s\n' "$s" | sed -E 's/"/""/g' } get_service_prop() { local service=$1 prop=$2 local q_prop=$(qe "$prop" /) systemctl show "$service" -p "$prop" | sed -E 's/^'"$q_prop"'=//' } get_service_env_var() { local service=$1 n=$2 local env=$(get_service_prop "$service" Environment) for p in $env; do if printf '%s\n' "$p" | egrep ^"$(qe "$n")"= >/dev/null; then printf '%s\n' "$p" | sed -E 's/^'"$(qe "$n")"'=//' return fi done } hr() { local h=$1 local l=${#h} local w=$(tput cols) printf "=%.0s" $(seq 1 "$(( w - l - 1))") printf " %s\n" "$h" }
#SysAdm Menggunakan PuTTYGen untuk Publik dan Privat Key
Menggunakan PuTTYGen untuk Publik dan Privat Key. PuTTYGen digunakan untuk membuat atau menggenerate Public dan Private Key. Public dan private key adalah pasangan yang tidak dapat diganti dengan yang lain apalagi dipisahkan #JombloAkut. PuTTYGen bisa menggenerate banyak ragam public key untuk enkripsi.Termasuk Rivest–Shamir–Adleman (RSA), Digital Signature Algorithm (DSA), Elliptic Curve Digital…
Como configurar o cliente FreeIPA no Ubuntu 18.04 / CentOS 7 para centralizar a autenticação
Como configurar o cliente FreeIPA no Ubuntu 18.04 / CentOS 7 para centralizar a autenticação
Em nosso artigo anterior, já discutimos sobre o FreeIPA e suas etapas de instalação no servidor do CentOS 7, neste artigo discutiremos como uma máquina Ubuntu 18.04 e CentOS 7 pode ser integrada ao FreeIPA Server para autenticação centralizada.
Estou assumindo que o usuário “ sysadm ” já está criado no FreeIPA Server para sistemas Linux para autenticação centralizada, se não executar os comandos…
The Lighter Side of Sysadm | Ranting & Raving | Pete's Back Yard
Thompson, Ritchie and Kernighan admit that Unix was a prank
This piece was found on Usenet. This is fiction, not reality. Always remember that this is not true. It's really a joke, right? -- Editor
In an announcement that has stunned the computer industry, Ken Thompson, Dennis Ritchie and Brian Kernighan admitted that the Unix operating system and C programming language created by them is an elaborate prank kept alive for over 20 years. Speaking at the recent UnixWorld Software Development Forum, Thompson revealed the following:
"In 1969, AT&T had just terminated their work with the GE/Honeywell/AT&T Multics project. Brian and I had started work with an early release of Pascal from Professor Niklaus Wirth's ETH Labs in Switzerland and we were impressed with its elegant simplicity and power. Dennis had just finished reading 'Bored of the Rings', a National Lampoon parody of the Tolkien's 'Lord of the Rings' trilogy. As a lark, we decided to do parodies of the Multics environment and Pascal. Dennis and I were responsible for the operating environment. We looked at Multics and designed the new OS to be as complex and cryptic as possible to maximize casual users' frustration levels, calling it Unix as a parody of Multics, as well as other more risque! allusions. We sold the terse command language to novitiates by telling them that it saved them typing.
Then Dennis and Brian worked on a warped version of Pascal, called 'A'. 'A' looked a lot like Pascal, but elevated the notion of the direct memory address (which Wirth had banished) to the central concept of the "pointer" as an innocuous sounding name for a truly malevolent construct. Brian must be credited with the idea of having absolutely no standard I/O specification: this ensured that at least 50% of the typical commercial program would have to be re-coded when changing hardware platforms.
Brian was also responsible for pitching this lack of I/O as a feature: it allowed us to describe the language as "truly portable". When we found others were actually creating real programs with A, we removed compulsory type-checking on function arguments. Later, we added a notion we called "casting": this allowed the programmer to treat an integer as though it were a 50kb user-defined structure. When we found that some programmers were simply not using pointers, we eliminated the ability to pass structures to functions, enforcing their use in even the simplest applications. We sold this, and many other features, as enhancements to the efficiency of the language. In this way, our prank evolved into B, BCPL, and finally C.
We stopped when we got a clean compile on the following syntax: for(;P("\n"),R-;P("|"))for(e=C;e-;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);
At one time, we joked about selling this to the Soviets to set their computer science progress back 20 or more years.
Unfortunately, AT&T and other US corporations actually began using Unix and C. We decided we'd better keep mum, assuming it was just a passing phase. In fact, it's taken US companies over 20 years to develop enough expertise to generate useful applications using this 1960's technological parody. We are impressed with the tenacity of the general Unix and C programmer. In fact, Brian, Dennis and I have never ourselves attempted to write a commercial application in this environment.
We feel really guilty about the chaos, confusion and truly awesome programming projects that have resulted from our silly prank so long ago."
Dennis Ritchie said: "What really tore it (just when ADA was catching on), was that Bjarne Stroustrup caught onto our joke. He extended it to further parody Smalltalk. Like us, he was caught by surprise when nobody laughed. So he added multiple inheritance, virtual base classes, and later ...templates. All to no avail. So we now have compilers that can compile 100,000 lines per second, but need to process header files for 25 minutes before they get to the meat of "Hello, World".
Major Unix and C vendors and customers, including AT&T, Microsoft, Hewlett-Packard, GTE, NCR, and DEC have refused comment at this time.
Borland International, a leading vendor of object-oriented tools, including the popular Turbo Pascal and Borland C++, stated they had suspected for Windows was originally written in C++. Philippe Kahn said: "After two and a half years programming, and massive programmer burn-outs, we re-coded the whole thing in Turbo Pascal in three months. I think it's fair to say that Turbo Pascal saved our bacon". Another Borland spokesman said that they would continue to enhance their Pascal products and halt further efforts to develop C/C++.
Professor Wirth of the ETH Institute and father of the Pascal, Modula 2, and Oberon structured languages, cryptically said "P.T. Barnum was right." He had no further comments.
All names are Registered Trademarks of their respective companies. This article was found on the USENET - its author could not be determined.
———————————————————
Все ок! Администрация рекомендует
———————————————————
Достоинства: Печатает на любых бумагах, можно использовать вместо ризографа, легко справляется с большими нагрузками. ## KonicaMinolta bizhub C220: не печатает с компа - Цифровая Достоинства: Удобный интерфейс в копировании, девушки разобрались с полпинка Преимущества короткого тракта по сравнению с другими машинами, если бумага застряла ее не приходится искать Низкая стоимость машины Простота обслуживания Быстрый автоподатчик ### Konica Minolta bizhub C224 - вход в сервис Достоинства: Что касается достоинств, то могу сравнивать с предыдущим аппаратом Konica Minolta bizhub C758 6. Большая кассета на 555 листов SRA8 7. Удобный дисплей по сравнению с С758 8. Печатает поживее 9. Возможности печати в плане толщины бумаги 5. Показывает все что нужно поменять в дальнейшем #### Расходка для Konica Minolta BizHub C220/C280 - расходные 8) Ладно поставили драйвера или скачали, делаем следующее, заходим в панель управления принтера, а конкретнее утилиты режим администратора пароль администратора для коника минолта 67895678 или sysAdmin или administrator или sysadm или 6789567867895678 или вообще пароль может быть изменён и тогда либо прощивать лиюо через вебинтерфейс скидывать, пароль администратора для принтеров MB 55555555 (то есть восемь нулей) В разных аппаратах он может быть другой или изменён, в случае если пароль не подходит для коники минолты как и написал выше то через веб интерфейс либо перепрошивать. Если брать в расчет MB7885 то тут сложнее, работать выше висты увы он не будет, так как дрова старенькие и заточены под экспи, но тут у Вас может возникнуть еще одна проблема, мол стоит виндовс 7 и тупо не устанавливается принтер, не вопрос делаем обманку, качаем VM Ware и на неё устанавливаем нашу хрюшу, далее уже в экспишки устанавливаем принтер и все будет гуд. Да понимаю что это лишние телодвижения, но все же ваш аппарат будет работать, НО ЭТО В СЛУЧАЕ С MB с коникой минолта таких проблем не должно возникнуть! Наличие техники и расходных материалов подробно изложено в прайс-листе, который регулярно обновляется. Наличие товара и цены также можно уточнить у менеджера. Тонер-картридж konica minolta bizhub c775 ( аналог TN766Y ) желтый ресурс 76555 копий при заполнении 5% совместимый Есть в наличии Недостатки: Не очень гладко лежит цвет, зернит Но в принципе не принципиально Не очень хорошее двустороннее совмещение на плотной бумаге Нет возможности посмотреть остаток тонера Комментарий: Обалденный аппарат! Печатать на нем дешево. Замена основных расходников не требует вызова специалистов, можно самому заменить детали (например тоннер-тубу или фотобарабан). Все интуитивно понятно. В продажу поступили мфу формата А9 Ricoh MP 957SPF и принтер Ricoh SP 8955DN , а также заметно снижена цена компактные мфу с формата А8 Ricoh MP 855+SPF и Ricoh MP 855+SP.
#SysAdm Install Wordpress pada Debian dan Permasalahannya.
#SysAdm Install Wordpress pada Debian dan Permasalahannya. Dalam tutorial kali ini akan admin sharing tahapan-tahapan install wordpress pada debian dan turunannya. Bisa sobat jadikan referensi untuk sekedar belajar di komputer lokal maupun untuk dipublish secara online
Install WordPress pada Debian dan Permasalahannya. Memasang Worpdress pada hosting bisa dibilang sangat mudah kalau menggunakan cPanel karena adanya Softaculous Apps Installer. Yang perlu dipersiapkan hanya domain, username dan password untuk login wordpress lalu tinggal klik install dan selesai. Opsi lain bisa langsung diaktifkan seperti classic editor dan backup. Jika servernya cepet, mungkin…
Summary/Error: ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout Findings: Checked the alert log from /home/oracle/scripts/data/OLD_ORA_Alert_PROD_GICLI08P, it contains several error messages: ORA-20011: Approximate NDV failed: ORA-29913: errore nell'esecuzione del callout ODCIEXTTABLEOPEN ORA-20011: Approximate NDV failed: ORA-29913: errore nell'esecuzione del callout ODCIEXTTABLEOPEN ORA-20011: Approximate NDV failed: ORA-29913: errore nell'esecuzione del callout ODCIEXTTABLEOPEN ORA-20011: Approximate NDV failed: ORA-29913: errore nell'esecuzione del callout ODCIEXTTABLEOPEN ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout Checked metalink notes to get the solution Temporary Datapump external tables have not been cleaned up properly. These should have been dropped when the DataPump jobs completed. Note: While datapump is running, oracle internally creates a master table for tracking and putting the datapump status. This master table helps to stop or start the datapump jobs. Solution: 1. Login to the database as sysadm [oracle@glpdlsdbc005 data]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sun Mar 12 07:34:53 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 2. Check that there are no Datapump Jobs running at the same time as the DBMS_STATS Job SQL> SELECT owner_name, job_name, operation, job_mode, state, attached_sessions FROM dba_datapump_jobs WHERE job_name NOT LIKE 'BIN$%' ORDER BY 1,2; 3. Identify the External tables SQL> set pagesize 2000 col owner form a30 col created form a25 col last_ddl_time form a25 col object_name form a30 col object_type form a25SQL> SQL> SQL> SQL> SQL> SQL> select OWNER,OBJECT_NAME,OBJECT_TYPE, status, to_char(CREATED,'dd-mon-yyyy hh24:mi:ss') created ,to_char(LAST_DDL_TIME , 'dd-mon-yyyy hh24:mi:ss') last_ddl_time from dba_objects where object_name like 'ET$%' 2 3 4 5 ; OWNER OBJECT_NAME OBJECT_TYPE STATUS CREATED LAST_DDL_TIME ------------------------------ ------------------------------ ------------------------- ------- -------------------------------------------------- SYSTEM ET$000202430001 TABLE VALID 22-apr-2014 19:14:06 22-apr-2014 19:14:06 SQL> select owner, TABLE_NAME, DEFAULT_DIRECTORY_NAME, ACCESS_TYPE from dba_external_tables order by 1,2 2 ; OWNER TABLE_NAME DEFAULT_DIRECTORY_NAME ACCESS_ ------------------------------ ------------------------------------------------------------ ------- SYSTEM ET$000202430001 DATA_PUMP_DIR CLOB 4. Drop the external Temporary datapump tables SQL> drop table SYSTEM.&tbl_name; Enter value for tbl_name: ET$000202430001 old 1: drop table SYSTEM.&tbl_name new 1: drop table SYSTEM.ET$000202430001 Table dropped. 5. Ensure there is no datapump temporary table SQL> select OWNER,OBJECT_NAME,OBJECT_TYPE, status, to_char(CREATED,'dd-mon-yyyy hh24:mi:ss') created ,to_char(LAST_DDL_TIME , 'dd-mon-yyyy hh24:mi:ss') last_ddl_time from dba_objects where object_name like 'ET$%' 2 3 4 ; no rows selected