Posts by Diego • 515 points
16 posts
-
2
votes2
answers85
viewsQ: Add rows with the same ID in additional columns
I have the following Table scenario: +-------------------------------------------------------------+ | ID | DATA | PROFISSAO | SEQUENCIA | +-------|…
-
1
votes2
answers50
viewsA: Add . html extension at the end of all links in multiple files (with Shell Script)
Considering files in the current directory in . html format and that within these files there are only links, would look like this: find . -type f -name *.html -exec sed 's/$/.html/g' {} \;…
-
0
votes2
answers139
views -
2
votes1
answer1379
viewsA: Problem trying to open port on a linux server
After validating that your port is actually standing, use the following commands to release INPUT and OUTPUT. iptables -A INPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate ESTABLISHED,NEW -j…
-
1
votes1
answer47
viewsA: Command in the Shell
The commands used are correct, but the use of quotation marks in the wrong place causes the error. Follows: ssh -oStrictHostKeyChecking=no user@IP "cd /home/user/backup_database/hour/ && cp…
-
4
votes1
answer691
viewsA: GIT error sending project to Ionic Pro: fatal: sha1 file '<stdout>' write error: Broken pipe
Your SSH session "broke". In your SSH configuration file (HOME .ssh config) add the following line: ServerAliveInterval 30 This will cause the client to send an "OI" to the server warning that the…
-
0
votes2
answers79
viewsA: Join for unequal records in R
From what I understand you don’t need Merge, only use a RIGTH JOIN for records that appear only in the right table, that is, the record of the left table will be null. SELECT * FROM TableA TA RIGHT…
-
0
votes2
answers8165
viewsA: Shell Bash, How to pass given from Shel as parameter
Your script getting the IP as parameter is thus: #!/bin/bash VARIAVEL_IP="$1" # $1 se refere ao primeiro parâmetro passado na command line # TESTE echo "IP passado como parâmetro: $VARIAVEL_IP" If…
-
3
votes1
answer1265
viewsQ: List specific directory in Windows - Filter in the list
I have the scenario with the following directories in alphabetical order: Y:\imagens\A001\B001\imagem.jpg Y:\imagens\A001\B002\imagem.jpg Y:\imagens\A002\B001\imagem.jpg…
-
1
votes2
answers466
viewsA: Check empty directories and pick up command output
You need to put a if in command line. Would be next: if [ `find . -type f | wc -l` -ge 1 ] ; then echo "Existe arquivos"; else echo "Nao existe arquivos"; fi…
-
2
votes1
answer147
viewsA: Show only lines that appear more than x times. (shell script)
You will use the following command: sort SeuArquivo | uniq -c If you still want to sort by the number of occurrences use: sort SeuArquivo | uniq -c | sort -nr…
-
1
votes1
answer103
viewsA: How to dynamically insert a DNS into /etc/hosts via a bash script?
Within your script runmydocker.sh we will basically have the following: #!/bin/bash HOST=$1 # Atribui o primeiro parâmetro passado no script a variável HOST echo "127.0.0.1 $HOST" >>…
-
3
votes2
answers54
viewsA: How to run a bash file "mytest.sh" on a MAC without using ". /" alias and globally?
Has two alternatives. First: Add the directory that is located your script in the PATH variable to facilitate execution PATH=$PATH:~/opt/bin:~/dev/bin:/seu/diretorio/ So you’ll just need to type the…
-
2
votes1
answer55
viewsA: Accessing Debian server via IP externally
Set up a Virualhost in your apache pointing to the port you want. Example: <VirtualHost *:8080> ServerName servico.mydomain.com ProxyPreserveHost On ProxyPass /…
-
1
votes1
answer451
viewsA: Java proxy configuration on Linux system
Set the proxy setting as the global OS variable as follows: Proxy without authentication: $ export http_proxy="http://PROXY_SERVER:PORT" $ export https_proxy="https://PROXY_SERVER:PORT" $ export…
-
3
votes1
answer3146
viewsQ: Turn rows into a select column - PIVOT - SQL Server
I have an SQL query that returns the following result: Consultation +--------------------------------------------------------------------------+ | CONJUNTO | TIPO | FILHO | PAI | TIPO_CONTEUDO |…