Get(FoundCount) – Filemaker functions

By Zilli,

Get(FoundCount)

Purpose
Returns a number that represents the number of records in the current found set.

Format
Get(FoundCount)

Parameters
None

Data type returned
number

Description
If there are multiple windows open in the current database file, each window can have its own found count value, but results are returned for only the foreground window.
If you specify the context for the current calculation, this function will be evaluated based on that context; otherwise, it will be evaluated based on the context of the current window.
Note For information on how functions evaluate differently on the host versus the client, search the FileMaker Knowledge Base available at www.filemaker.com/kb.

Examples
Returns 7 when there are 7 records in the current found set.

Issue report
http://forums.filemaker.com/posts/279a1a7a76

Manually update a new version of wordpress

By Zilli,

1. back up all your wordpress files and databases
2. download the latest version of wordpress
3. deactivate all your plugins: Go to Plugins >Installed plugins
4. Now keep the following files/folders in your web directory:

  • wp-config.php
  • wp-content
  • .htaccess

  Category: OS
  Comments: None

Downgrade Synology DSM 5.0 to 4.3

By Zilli,

What you’ll need:
DSM5.0-4482 (or newer is installed) for your particular DS.
DSM4.3-3827 for your particular DS.
Assistant Synology DS
A network and some cables.
A disk to be used for installation.
Your data, back up a safe place.
A DiskStation be downgraded.
Get the DSM versions here

… Continue reading

  Category: OS
  Comments: None

How to quickly add a route in OSX

By Zilli,

sudo route -n add 10.10.10.10/16 192.168.4.11
sudo route -n delete 10.10.10.10/16 192.168.4.11

Viewing route table with:

netstat -nr

ROUTE(8) BSD System Manager’s Manual

NAME
route — manually manipulate the routing tables

SYNOPSIS
route [-dnqtv] command [[modifiers] args]

DESCRIPTION
Route is a utility used to manually manipulate the network routing tables. It normally is not needed,
as a system routing table management daemon such as routed(8), should tend to this task.

The route utility supports a limited number of general options, but a rich command language, enabling
the user to specify any arbitrary request that could be delivered via the programmatic interface dis-cussed discussed
cussed in route(4).

https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/route.8.html

CLI – List of all MySQL command

By Zilli,

List of all MySQL commands:
Note that all text commands must be first on line and end with ‘;’

?         (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit      (\e) Edit command with $EDITOR.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
nopager   (\n) Disable pager, print to stdout.
notee     (\t) Don't write into outfile.
pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
system    (\!) Execute a system shell command.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.

  Category: OS
  Comments: None

CLI essential Linux commands

By Zilli,

Find file name 
find / -type f -name RRDs.pm

Find folder name
find / -type d -name ‘folder name’

Find text
find /into/this/dir -name ‘*.php’ -print0 | xargs -r -0 grep -l texttofind

Sort file size in reverse order
ls -lSr

Show last rows of file
tail -f filename

Display active process
ps -w | grep spamd

info processor architecture
cat /proc/cpuinfo | grep model

Zip compress
zip -rv file.zip folder_to_zip
unzip -v filename.zip

To extract all members of letters.zip into the current directory only:
unzip -j letters

To test letters.zip, printing only a summary message indicating whether the archive is OK or not:
unzip -tq letters

To test all zipfiles in the current directory, printing only the summaries:
unzip -tq \*.zip

Set up scaling option for DSM Synology

By Zilli,

* Check scaling setup:

sysctl net.ipv4.tcp_window_scaling

* Turned off scaling to 0 as root:

sysctl -w "net.ipv4.tcp_window_scaling=0"

* To maintain the changes after a restart, include the file S99sysctl.sh:

vi /usr/syno/etc/rc.d/S99sysctl.sh
#!/bin/sh
sysctl -w "net.ipv4.tcp_window_scaling=0"
 chmod +x /usr/syno/etc/rc.d/S99sysctl.sh

 

RELATED:
Slow connection and email attachments download to 0 kb

Configuration of operating systems

TCP Window Scaling is implemented in Windows since Windows 2000. It is enabled by default in Windows Vista / Server 2008 and newer, but can be turned off manually if required.

Linux
Linux kernels (from 2.6.8, August 2004) have enabled TCP Window Scaling by default. It chooses the good value of the option by default. The configuration parameters are found in the /proc filesystem, see pseudo-file /proc/sys/net/ipv4/tcp_window_scaling and its companions /proc/sys/net/ipv4/tcp_rmem and /proc/sys/net/ipv4/tcp_wmem

Scaling can be turned off by issuing the command sysctl -w “net.ipv4.tcp_window_scaling=0” as root. To maintain the changes after a restart, include the line “net.ipv4.tcp_window_scaling=0” in /etc/sysctl.conf.

FreeBSD, NetBSD and Mac OS X 
The default setting for FreeBSD, NetBSD and Mac OS X is to have window scaling (and other features related to RFC 1323) enabled.
To verify their status, a user can check the value of the “net.inet.tcp.rfc1323” variable via the sysctl command:

sysctl net.inet.tcp.rfc1323

A value of 1 (output “net.inet.tcp.rfc1323=1”) means scaling is enabled, 0 means “disabled”. If enabled it can be turned off by issuing the command:

sudo sysctl -w net.inet.tcp.rfc1323=0

This setting is lost across a system restart, to make it permanent it must be written in the /etc/sysctl.conf configuration file, that can be accomplished via the command:

echo 'net.inet.tcp.rfc1323=0' | sudo tee -a /etc/sysctl.conf

 

  Category: OS
  Comments: None

Introduzione e comandi principali di VI

By Zilli,

Ci sono molti editor di testo sui sistemi *nix, ma VI e’ senza dubbio il piu’ diffuso. VI sta per VIsual editor e VIM e’ una versione migliorata di VI. Puoi trovare VI in qualsiasi distribuzione Linux, su Unix e sui sistemi Mac Os X. Per questa ragione occorre impararlo. VIM e’ un editor testuale, percio’ non ci sono tutti i fronzoli tipici degli editor di testo grafici. Ad ogni modo VIM e’ un potente editor di testo. Ci sono tre modalita’ in VI:

1) modalita’ comando
2) modalita’ riga comando
3) modalita input

Per provare VI, apri una finestra di Terminale e digita ‘vi qualcosa’. Non appena si entra in VI ci si trova in modalita’ comando. Per entrare in modalita’ riga comando premi il tasto ‘:’. Per entrare in modalita’ input premi ‘i’ oppure ‘a’. Vediamo una semplice sessione di editing:

1) vi miofile (stai crendo il file miofile)
2) premi ‘a’ per entrare in modalita’ input e digita ‘questo e’ un semplice file di testo’
3) ora premi ‘:’ per entrare in modalita’ riga comando e digita ‘w!’ (con questo comando si scrive il file e si esce da VI)

Puoi spostarti dalla modalita’ input a quella comando o dalla modalita’ riga comando a quella comando premendo il tasto Esc.

Principali comandi in modalita’ comando

  • w -> vai all’inizio della prossima parola
  • b -> vai all’inizio della precedente parola
  • e -> vai alla fine della prossima parola
  • n| -> vai alla colonna ‘n’ della riga corrente
  • $ -> vai alla fine della riga corrente
  • ^ -> vai al primo carattere della riga corrente
  • G -> vai alla fine del file
  • gg -> vai all’inizio del file
  • Gn -> vai alla riga ‘n’ del file
  • i -> modalita’ inserimento (prima del cursore)
  • a -> modalita’ inserimento (dopo il cursore)
  • o -> modalita’ inserimento (sotto la riga corrente)
  • x -> cancella un carattere
  • nx -> cancella ‘n’ caratteri
  • dd -> cancella l’intera riga
  • ndd -> cancella ‘n’ righe
  • yy -> copia la riga corrente
  • p -> incolla la riga copiata
  • Rmiastringa -> sostituisce i prossimi caratteri con la stringa ‘miastringa’
  • /stringa -> trova la prossima stringa ‘stringa’
  • ?stringa -> trova la stringa ‘stringa’ all’indietro
  • n -> ripete la ricerca nuovamente
  • u -> annulla l’ultimo comando

Principali comandi in modalita’ riga comando

  • :w -> scrive il file
  • :w nome_file -> scrive il file come ‘nome_file’
  • :q -> esce da vi
  • :wq -> scrive ed esce dal file
  • :q! -> esce dal file senza salvare
  • :help -> apre il file di aiuto (:q per tornare ad editare il file)
  • :help argomento -> apre il file di aiuto all’argomento specificato da ‘argomento’ (:q per tornare ad editare il file)
  • :rs/stringa1/stringa2/opzioni -> sostituisce stringa1 con stringa2 all’interno del range ‘r’; le opzioni possono essere: g (sostituisce tutto), c (chiede conferma prima di ongi sostituzione)
  • :set number -> imposta la numerazione delle righe

Puoi imparare altri comandi (ce ne sono tantissimi) usando il comando :help. Certo, e’ anche possibile usare il comando ‘man vi’. Il miglior modo per imparare VI e’ iniziare ad usarlo.

Link utili:

  Category: OS
  Comments: None