Skip to content

Instantly share code, notes, and snippets.

View kuleszaj's full-sized avatar

Justin Kulesza kuleszaj

  • Grand Rapids, MI
View GitHub Profile
@kuleszaj
kuleszaj / Nagios
Created November 24, 2010 20:22
Sample configuration code to check host availability (using ping) with Nagios.
# Define our host
define host{
use linux-server
host_name someserver.local
alias someserver.local
address 192.168.1.1
}
# Define ping service parameters warning at 100ms response time and 20% packet loss
# and failure at 500ms response time and 60% packet loss
@kuleszaj
kuleszaj / Monit
Created November 24, 2010 20:23
Sample configuration code to monitor Apache with Monit.
check process apache with pidfile "/var/run/httpd.pid"
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
[kulesza@db ~]$ grep -n "Table structure" global_us_phpbb.sql
19:-- Table structure for table `ajax_chat_bans`
43:-- Table structure for table `ajax_chat_messages`
73:-- Table structure for table `ajax_chat_online`
100:-- Table structure for table `phpbb_acl_groups`
129:-- Table structure for table `phpbb_acl_options`
157:-- Table structure for table `phpbb_acl_roles`
186:-- Table structure for table `phpbb_acl_roles_data`
212:-- Table structure for table `phpbb_acl_users`
241:-- Table structure for table `phpbb_attachments`
[kulesza@db ~]$ sed -n '402,427 p' global_us_phpbb.sql > tmp.sql
[kulesza@db ~]$ head tmp.sql
-- Table structure for table `phpbb_config`
--
DROP TABLE IF EXISTS `phpbb_config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `phpbb_config` (
`config_name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
[kulesza@db ~]$ mysql -u root -p my_temp_database < tmp.sql
$ grep -n "Table structure" [MySQL_dump_filename].sql
$ sed -n '[starting_line_number],[ending_line_number] p' [MySQL_dump_filename].sql > [table_output_filename].sql
$ mysql -u root -p [some_database_name] < [table_output_filename].sql
[kulesza@home ~]$ echo -e "\x80iconv\x20\x80will\x20\x80not\x20\x80like\x20\x80this" | iconv -t LATIN1//IGNORE -f UTF-8
iconv will not like this
iconv: illegal input sequence at position 30
[kulesza@home ~]$ echo -e "\x80iconv\x20\x80will\x20\x80not\x20\x80like\x20\x80this" | iconv -t LATIN1 -f UTF-8
iconv: illegal input sequence at position 0